各种选择框jQuery的选中方法(实例讲解)
select下拉列表的选中方法是:$("slectoption:eq(1)").attr("selected",true);//选中第二个option
chekbox的选中方法:$("[value=check1"]:checkbox).attr("checked",true);
radio的选中方法:$("[value=radio2"]:radio).attr("checked",true);
以上是简写,重要的是看代码:
3-10-4 .test{ font-weight:bold; color:red; } .add{ font-style:italic; } //
选择1号 选择5号
多选1 多选2 多选3 多选4
单选1 单选2 单选3
以上这篇各种选择框jQuery的选中方法(实例讲解)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。