Nearly there I think - its doing something now, but is the reverse of what it should be.
When the ‘select all’ checkbox is ticked, the others are unchecked. And when it is unchecked, all the others are ticked.
Apart from when you first tick the select all.
So from page load:
- Nothing ticked.
- Check the select all checkbox - nothing happens.
- Uncheck the select all checkbox - all the others become checked.
- Check the select all checkbox - all the others become unchecked.
I tried changing
checkboxes[i].checked = source.checked;
to
checkboxes[i].unchecked = source.unchecked;
But that just broke it.