irt.org - JavaScript FAQ Knowledge Base

I was not sure if you accepted outside input for code, but I have used this site for years, and it is always my first place to check for code. I sometimes put together pieces that I thought your users could use, but could not find where I could submit it. I thought I would try here. The site is the Absolute Best!!
Q: Javascript: How do I change an image when a checkbox is checked or unchecked?

<img src="image1.gif" height=15 width=15 name="im99">
<input type="checkbox" name="S123" onClick="if (this.checked)
document.im99.src='image2.gif'; if (this.checked == false)
document.im99.src='image1.gif'";>
Related topics:
Share: Digg | Del.icio.us | Stumble | Reddit | Float | Technorati
Leave a comment!
Note: You can also use your free Gravatar avatar on Knowtebook! Please also read our Publishing Policy before posting.

Yes, I would like to receive notification on incoming comments!