If I have a choice like this
<select id="selectid" name="selectname" onchange="jsfunc1()"> <option value="val1" id="valid1"> Val1 </option> <option value="val2" id="valid2"> Val2 </option> <option value="val3" id="valid3"> Val3 </option> </select>
Now I have a javascript func2 function, let's say something needs to be done if the val1 option is selected. How can I do it?
For instance,
function func2(){ .... if(document.getElementById('valid2').selected==True){
I do not get the exact syntax and that is where I need your help.
source share