Js handles problem resolution with drop down list

  • 2020-03-30 01:42:09
  • OfStack

 
var obj=document.getElementByIdx("test"); 
if(0<obj.options.length){ 
//obj.options.remove(obj.selectedIndex); //IE  available  
obj.options[obj.selectedIndex]=null;//IE FF
for(var i=0;i<obj.options.length;i++){//For just to reorder... You can ignore
obj.options[i].text=" children "+i; 
obj.options[i].value=i; 
} 
if(0<obj.options.length){//The first choice state
obj.options[0].selected=true; 
} 
} 


Related articles: