我在循环中包含了一个检查(如果($(此).val()> 0),我想消除它,并在主语句中包含这个条件?
$('#subtabs').find("input[type='radio'][id^='cf_']:checked")....
$('#subtabs').find("input[type='radio'][id^='cf_']:checked").each(function (index, value) {         
        if($(this).val() > 0) {
            .....           
            });
        }           
    });发布于 2022-05-31 22:32:50
试试这个,我希望能帮到你;
$('#subtabs').find("input[type='radio'][id^='cf_']:checked")
.each(function (index, value) {         
    // Only below line has changed. Use "value" variable instead of "this". Actually "value" is not a value, it is a tag element of selected list.
    if($(value).val() > 0) {
        // ...                       
    }           
});https://stackoverflow.com/questions/72417516
复制相似问题