JSFiddle - React, Tailwind, and code Playground
HTML
<table id="tbl" border="1">
<tr><input type="checkbox" id="selectall"/>
<td>
<input type="checkbox"/></td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr><td><input type="checkbox"/></td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr><td><input type="checkbox"/></td>
<td>2</td>
<td>3</td>
<td>5</td>
</tr>
</table>
<input type="button" id="save" value="save"/>
JavaScript
$('#selectall').click(function(event) {
if(this.checked) {
// Iterate each checkbox
$(':checkbox').each(function() {
this.checked = true;
});
}
else {
$(':checkbox').each(function() {
this.checked = false;
});
}
});
$("#save").click(function(){
/If all selected value has to pass through ajax one by one row/
});