jquery dynamically adds option
js dynamically add option
var sel= document.getElementById("Selected1");
sel.options.add(new Option("Please select",""));
sel.options.add(new Option("name","id"));
jquery dynamically adds option
$("#selectId").append("< ;option value='" value "'>" text "");
jquery removes all options
$("#selectedId option").remove() ;
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