单选框相关操作

获取单选框选中的值

var subjectType = $('input:radio[name="entity.subjectType"]:checked').val();      if(subjectType == null)

设置value=1的选项为选中状态

$("input[name='entity.isTax'][value='1']").attr("checked",'checked');

单选框选中的值清空

$('input:radio[name="entity.subjectType"]:checked').attr("checked",false);

判断单选框是否选中

$("input[type=radio]").each(function(){

  if($(this).is(":checked")){

    alert(“选中”);

  }

});

 

posted @ 2019-05-07 18:32  lost_s  阅读(186)  评论(0编辑  收藏  举报