I can not understand what am I doing wrong ? I think I have written everything really well:
The HTML code goes like this:
<b> Select Area</b>
<select id="mySelect_1" onchange="showSelectedArea();" >
<option selected disabled hidden value=''></option>"
<option value="1">Center</option>
<option value="2">New jersey</option>
</select>
and the Javascript is this:
layer1.setVisibility(false);
layer2.setVisibility(false);
layer3.setVisibility(false);
layer4.setVisibility(false);
}
function showSelectedArea() {
var e = document.getElementById("mySelect_1");
var valueEpilogi_1 = e.options[e.selectedIndex].value;
if (valueEpilogi_1 == "1") {
layer3.setVisibility(true);
}
}
I dont think the problem is with the if or passing the value,if I set true == true it still wont set visibility to true.I think there is a problem with triggering the function at the select tag.
Please check my external js file and tell me what is the problem?? I define all layers in init function which runs onbody load ??is tha thte problem? snk.to/f-cdh90xd4