1、
select 标签
(1)Jquery 获取select选中值:
$("#design option:selected").val();
(2)获取select 选中的文本内容:
$("#design option:selected").text();
(3)设置select某项选中:
$("#fs option[value="+data.fs_score+"]").attr("selected",true);
2、
checkbox 标签
(1)获取选中的checkbox 的值:
$('input[name="test"]:checked').each(function(){
chk_value.push($(this).val());
});
(2)
判断某个checkbox是否被选中
if($("#"+personId).is(':checked'))
(3)
取消checkbox选中状态
$("#"+personId).attr("checked",false);
(4)全选
(5)取消全选
$("[name='checkbox']").removeAttr("checked");
3、radio 标签
(1)获取radio 选中的值
$('input:radio:checked').val();
$("input[type='radio']:checked").val();
$("input[name='rd']:checked").val();
(2)设置某个radio选中
$("input[name='nd_radio'][value='要选中Radio的Value值']").attr("checked",true);
4、切换标签样式绑定方法
$("#leibie span").bind("click",function(){
$("#leibie span").not(this).removeClass("on");
$(this).addClass("on");
var stage_id = $(this).attr("id");
showSubject(stage_id);
});