I need to select all cities under states (eg. India) listed. I put a select all:
<input type="checkbox" class="selectall" /> Select All
Then the below error is appearing:
this.elem.prop is not a function
This is my code:
jQuery('.selectall').click(function() {
stop = false;
jQuery(this).closest('div').nextAll().each( function() {
elem = jQuery(this).find('input');
console.log(elem);
if (stop || elem.hasClass('selectall')) {
stop = true;
return;
}
else
elem.prop("checked", true);
});
});