Reset combox box in html with given index

<select id="myCombo" onchange="moreOptions()">
      <option value="-1" selected="selected">Select options</option>
      <option id=" myCombo _1" value="1">One</option>
      <option id=" myCombo _2" value="2">Two</option>
      <option id=" myCombo _3" value="3">Three</option>

Javascript to reset onChange() method...

function moreOptions(){
var selectedOption=document.getElementById(" myCombo ").value;
}else if(selectedOption=="2"){
}else if(selectedOption=="3"){
         document.getElementById(" myCombo ").selectedIndex="0";   //reset combox box with "Select options"


Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Session timeout interceptor in struts 2