/ /Get html control var select = document.getElementsByName("aaa")[0];
select.selectedIndex = index; //Create a new Option object new Option( text, value) new option(text, value, defaultSelected, selected text: string, specifying the text attribute of the option object (that is, the text between ) value: String, specify the value attribute of the option object defaultSelected: Boolean value, specify the defaultSelected attribute of the option object selected: Boolean value, specify the selected attribute of the option object
//Delete select.options.remove(index) //Delete all select at once .length = 0;
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