jquery 操作select radio box 备忘
2013年3月31日
没有评论
select框操作
获取值
$('#select').val()
设置值为xx的项为选中
$('#select').val(xx)
设置文本信息为yy的项为选中
$('#select option[text="yy"]').attr("selected", true);
radio box 操作
获取值
$('input[name="xx"]:checked').val()
设置值为xx的为选中
$('input[name="xx"]:radio[value="yy"]').attr('checked', 'checked');
