Lars Pind

internet software, coaching, and entrepreneurship

Lars Pind - internet software, coaching, and entrepreneurship
Check out Coach TV, my video blog on happiness and personal development for geeks.

Use onclick, not onchange for checkboxes

June 09, 2006 · 0 comments

Note to self: Always use onclick, not onchange, on checkboxes.

Most browsers work fine, but Internet Explorer only seems to invoke onchange when the checkbox loses focus. However, onclick is invoked whenever the value changes, even if it wasn’t clicked, but triggered with the keyboard. Go figure.