Home >Web Front-end >JS Tutorial >Js and drop-down list processing problem solving_javascript skills

Js and drop-down list processing problem solving_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:00:101002browse

Copy code The code is as follows:

var obj=document.getElementByIdx("test");
if(0//obj.options.remove(obj.selectedIndex); //IE available
obj.options[obj.selectedIndex]=null;// Both IE FF can
for(var i=0;iobj.options[i].text=" Subitem" i;
obj.options[i].value=i;
}
if(0obj.options [0].selected=true;
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn