I am trying to print select in multiple drop-down list, but prints only two words(CHENNAI AND IOS-XE , BANGALORE AND IOS-XR) could not print the remaining words Can anyone help me fix this?
Required Output :
if i select CHENNAI+IOS-XE ---> output : CHENNAI AND IOS-XE
else if BANGALORE+IOS-XR ---> output : BANGALORE AND IOS-XR
else if CHENNAI+IOS-XR ---> output : CHENNAI AND IOS-XR
else if BANGALORE+IOS-XE ---> output : BANGALORE AND IOS-XE
<html>
<body>
<p>SELECT THE REGION </p>
<select id="choose">
<option value="a1">CHENNAI</option>
<option value="b1">BANGALORE</option>
</select></p>
<p>SELECT THE ROUTER TYPE </p>
<select id="choose1">
<option value="a2">IOS-XE</option>
<option value="b2">IOS-XR</option>
</select></p>
<button onclick="button()">CLICK</button>
<script>
function button() {
var x = document.getElementById("choose").value;
var y = document.getElementById("choose1").value;
if (x == 'a1' || y == 'a2' ) {
document.write("CHENNAI AND IOS-XE");
}
else if (x == 'b1' || y == 'b2'){
document.write("BANGALORE AND IOS-XR");
}
else if (x == 'a1' || y == 'b2'){
document.write("CHENNAI AND IOS-XR");
}
else if (x == 'b1' || y == 'a2'){
document.write("BANGALORE AND IOS-XE");
}
}
</script>
</body>
</html>