相关疑难解决方法(0)

使用jQuery切换输入禁用属性

这是我的代码:

$("#product1 :checkbox").click(function(){
    $(this)
        .closest('tr') // Find the parent row.
            .find(":input[type='text']") // Find text elements in that row.
                .attr('disabled',false).toggleClass('disabled') // Enable them.
                .end() // Go back to the row.
            .siblings() // Get its siblings
                .find(":input[type='text']") // Find text elements in those rows.
                .attr('disabled',true).removeClass('disabled'); // Disable them.
});
Run Code Online (Sandbox Code Playgroud)

我如何切换.attr('disabled',false);

我似乎无法在Google上找到它.

jquery toggle attr

177
推荐指数
4
解决办法
17万
查看次数

标签 统计

attr ×1

jquery ×1

toggle ×1