JQuery Checkbox 获取选中值 Checkbox选中个数【单选】

 //单选
    $(':checkbox[name=ckb-jobids]').each(function () {

        $(this).click(function () {
            //单选
            if ($(this).is(':checked')) {
$(
":checkbox").each(function () {
$(
this).prop('checked', false); })
$(
this).prop("checked", true);
str
= $(this).attr("value"); //被选中的值 } }); });

 

posted @ 2022-04-01 15:05  双手插在裤兜谁也不爱  阅读(110)  评论(0)    收藏  举报