Ever wanted to allow a user to click the Select all checkbox and have all the checkboxes magically have checks in them?
The initial solution (not so good)
After copy pasting a bit of code here and there, I came up with a basic solution that uses document.getElementsByName
<input type="checkbox" onClick="toggle(this, 'product[location_id]')" />Select All<br/>
Now this worked fine until I tested it in IE. Dreaded IE! Turns out it doesn’t work because of an IE bug that doesn’t like document.getElementsByName
The best solution