且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery按钮单击以选中复选框

更新时间:2023-11-30 19:23:10

$('#myButton').click(function() {
    $('#Grid input[type=checkbox]:lt(5)').attr('checked','checked');
});

如果网格中还有其他复选框,则可能存在问题.这是我***的办法,而又看不到您的HTML.

If you have other checkboxes in the grid, there may be in issue. This is the best I can do without seeing your HTML.