[ Home ]

If you want to make something happen when a checkbox is ticked or unticked, it may appear at first that the onchange event would be better than onclick, because one might press the spacebar instead of clicking the mouse. Unfortunately older versions of internet explorer don't fire the onchange event until the element loses focus. Fortunately, all major browsers will fire the "onclick" event, even if you used the spacebar.

For example you may want to show either a text input or a drop-down input for some field:

Type in custom value

Value:


See the source code for more information.