I found this in jQuery Doc
Because: lt () is an extension of jQuery and not part of the CSS specification, queries using: lt () cannot take advantage of the performance enhancement provided by the built-in DOM request of the SelectorAll () method. For best performance in modern browsers, use $ ("your-clean-css-selector"). slice (0, index) instead.
Based on the accepted answer, you can do this:
$('#myButton').click(function() { $("#Grid input[type=checkbox]").slice(0,5).attr('checked','checked'); });
source share