jQuery “没有属性”选择器

可以使用.not():not() 选择器。

$('.container:not([data-timestamp])')
或者

$('.container').not('[data-timestamp]') 

实战,

<td>
    <input class="check-one" <?php if ($vo['super']) { echo  'disabled';} ?> type="checkbox" name="id" value="{$vo.id}" lay-skin="primary">
</td>
form.on('checkbox(checkall)', function (data) {
    if (data.elem.checked) {
        $('tbody input.check-one:not([disabled])').prop('checked', true);
    } else {
        $('tbody input.check-one:not([disabled])').prop('checked', false);
    }
    form.render('checkbox');
});

被禁用的将不会选中。

原文地址:https://www.cnblogs.com/jiqing9006/p/11188002.html