I have a rather bizarre situation where I am trying to iterate through check boxes using each
. Problem is it does not want to go in the loop.
Please advise as to why?
This is the function
function AddTheProduct() {
var txtTopicsGuids = "";
var checkedTopics = document.getElementsByName("chkRelatedTopics");
$(checkedTopics).each(function() {
if ($(this).is(":checked")) {
//action
}
});
and the markup
{{each Items}}
<tr>
<td>
<input type='hidden' name='hidTopicsDomain' value='${DomainObjectKey}'/>
<input type='checkbox' name='chkRelatedTopics' value='${subject}'/>
</td>
</tr>
{{/each}}