I am getting a table element for a given row in the table using the following code in jQuery 1.8.2.
var tbl = $("input[id$='chkSelectAll']").closest('table'); Now, I want to replace the JavaScript code below with corresponding jQuery script. What would be the jQuery for this code below?
It would be nice if I could just get the table rows as an array from the above tbl variable in jQuery, as that would solve my problem.
for (var i = 1;i < tbl.rows.length - 1;i++) { var chk = tbl.rows[i].cells[0].firstChild; //we have a checkbox in first cell of every row chk.checked = chkAll.checked; }