码迷,mamicode.com
首页 > Web开发 > 详细

JQuery设置Radiobutton状态(是否选中)

时间:2015-02-04 12:22:24      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:

贴代码:(HTML)

<td colspan=‘4‘ style="align:left">
    <input type="radio" style=‘width:10px‘ checked=‘checked‘ name="type" value="行政村" />行政村
    <input type="radio" style=‘width:10px‘ name="type" value="自然村" />自然村
</td>

JQuery代码:

$(input[name = "type"]:eq(0)).attr("checked", false);        //set first button checked, index begin: 0;
$(input[name = "type"]:eq(1)).attr("checked", true);        //set second button checked;

 

JQuery设置Radiobutton状态(是否选中)

标签:

原文地址:http://www.cnblogs.com/Teofil/p/4271849.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!