How to Select Option Value in javascript Via?

Hi Below Code useful for yours Enjoy.
<script language=”javascript” type=”text/javascript”>
// For Option Value Selected in javascript Via

var myselect=document.getElementById(“myList”)
for (var i=0; i<myselect.options.length; i++){
myselect.options[i].selected=false;
//alert(“Selected Option’s index: “+i);
/* if (myselect.options[i].selected==true){
alert(“Selected Option’s index: “+i)
break
}*/
}
myselect.options[1].selected=true;
</script>

this is one of my method in javascript via options selection.

Leave a Reply

© 2020 Spirituality