I am rendering a list of checkboxes with values and want to retrieve these values as I am checking the correlating checkboxes.
{{each Items}}
<tr>
<td><input type='checkbox' name='chkRelatedTopics' value='${subject}'/></td>
<td><label id='labRelatedTopicDisplay'>${subject}</label>
<tr>
{{/each}}
as I am doing it at the moment I am getting the first value of the first checkbox rendered every time.
$(document).on("click", "input[name=chkRelatedTopics]", function () {
var nameAdminUser = $("input[name=chkRelatedTopics]").val();
alert(nameAdminUser);
});
How can I get the value of the subsequent checkbox I am checking?