![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
jq
苦逼老程序员
这个作者很懒,什么都没留下…
展开
-
清空select标签中option选项的4种不同方式
方法一 document.getElementById("selectid").options.length = 0; 方法二 document.formName.selectName.options.length = 0; 方法三 document.getElementById("selectid").innerHTML = ""; 方转载 2016-12-08 17:27:27 · 3859 阅读 · 0 评论 -
Js操作Select大全(取值、设置选中等等)
jquery操作select(取值,设置选中) 每一次操作select的时候,总是要出来翻一下资料,不如自己总结一下,以后就翻这里了。 比如 1、设置value为pxx的项选中 $(".selector").val("pxx"); 2、设置text为pxx的项选中 $(".selector").find("option[text='pxx']").a转载 2016-12-22 17:46:20 · 862 阅读 · 0 评论