Help me please.
There is a checkbox, at the mark of which you need to perform an action:
return categoryFilter('other1','1') If the mark is removed, you need to perform:
return categoryFilter('other1','') How to implement?
Help me please.
There is a checkbox, at the mark of which you need to perform an action:
return categoryFilter('other1','1') If the mark is removed, you need to perform:
return categoryFilter('other1','') How to implement?
$('input[type="checkbox"]').on('change', function() { if(this.checked) { categoryFilter('other1','1'); } else { categoryFilter('other1',''); } }); update
$('input[type="checkbox"]').on('change', function() { var id = this.getAttribute('id'); if(id == undefined) return; if(this.checked) { categoryFilter('other' + id, id); } else { categoryFilter('other' + id,''); } }); Source: https://ru.stackoverflow.com/questions/194139/
All Articles