I have checkboxes in my table rows with an attribute 'result-id'. How do I fill a javascript array with the values stored in 'result-id' checkbox, inside the table row.
I already figured out how to acces the data in jquery, now I just want to store that data inside of an array.
It looks a little something like this :
<td>
<input result-id="@item.Id" type="checkbox" />
</td>
This is the jquery I have now, it only adds one item (last clicked checkbox id)
$(tableBody).find('tr').each(function () {
if ($(this).find('input:checkbox').prop("checked") == true) {
resultList.fill(parseInt($(this).find('input:checkbox').attr('result-id')));
}
});