User-1634604574 posted
i have this table which it has a checkbox inside each td i want by clicking on button serialize that checkbox value when they are checked
i wrote this code but is not working
<table id="tb">
<tr>
<th>a1</th>
<th>a2</th>
</tr>
<tr>
<td><input type="checkbox" value="aa">aa</td>
<td><input type="checkbox" checked value="bb">bb</td>
</tr>
<tr>
<td><input type="checkbox" value="cc">cc</td>
<td><input type="checkbox" checked value="dd">dd</td>
</tr>
<tr>
<td><input type="checkbox" value="ee">ee</td>
<td><input type="checkbox" value="ff">ff</td>
</tr>
</table>
<br>
<input type="button" value="ok" id="b">
$("#b").on("click", function () {
var AddressesDataJSON;
$('input:checkbox:checked', '#tb').each(function () {
var t=$(this).prop('value');
AddressesDataJSON = $("#tb").find('input:checkbox').serializeArray();
});
alert(JSON.stringify(AddressesDataJSON));
})