I have an HTML page with multiple checkboxes.
I need one more checkbox by the name \"select all\". When I select this checkbox all checkboxes in the HTML page must b
I'm not sure anyone hasn't answered in this way (using jQuery):
$( '#container .toggle-button' ).click( function () { $( '#container input[type="checkbox"]' ).prop('checked', this.checked) })
It's clean, has no loops or if/else clauses and works as a charm.