calvin-brand-light-mode
calvin-brand-dark-mode
∕
⌘K
About Calvin Podcast We Can Do This Book Speaking
aAbout Calvin
Podcast
wWe Can Do This Book
sSpeaking
Back

Use onclick, not onchange for checkboxes

Other
Calvin Correli·Jun 9, 2006· 1 minute

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.

Previous Always use the for attribute on labels
Next @media looks fun -- anyone got a ticket?

Comments

Write a comment...
00:00 Recording...
calvin-brand-light-mode
calvin-brand-dark-mode
1 Chestnut Hill Plaza #1139
Newark, DE 19713
United States
Copyright © 2026 Calvin Correli
powered by