Since each animal checkbox for the purposes of your example is a unique value, ID rather than NAME is more appropriate:
Code:
function checkABox(id) {
document.getElementById(id).checked = true;
}
You will need to change name="fish", name="cat" etc. to id="fish", id="cat" and so on. Then use this type of onclick:
HTML Code:
<a href="#" onclick="checkABox('fish');checkABox('cat');return false;"> <img src="peter.jpg"> </a>
you can add as many checkABox calls as you want, each separated with a semicolon. Just be sure to add the:
;return false;
at the end to stop the page from reloading (performs a similar function as the return prefix in your original code but, for multiple calls).
Bookmarks