onchange event

[This documentation is preliminary and is subject to change.]

Fires when the contents of the object or selection have changed.

HTML 4.01 Specification, Section 18.2.3


HTML Attribute <element onchange = "handler(event)">
Event Property object.onchange = handler;
attachEvent Method object.attachEvent("onchange", handler)
addEventListener Method object.addEventListener("change", handler, useCapture)

Standards information

Event information

Synchronous No
Bubbles No
Cancelable No

Event handler parameters


This event is fired when the contents are committed and not while the value is changing. For example, on a text box, this event is not fired while the user is typing, but rather when the user commits the change by leaving the text box that has focus. In addition, this event is executed before the code specified by onblur when the control is also losing the focus.

The onchange event does not fire when the selected option of the select object is changed programmatically.

Changed text selection is committed.

To invoke this event, do one of the following:

  • Choose a different option in a select object using mouse or keyboard navigation.
  • Alter text in the text area and then navigate out of the object.

The pEvtObj parameter is required for the following interfaces:

See also




Build date: 1/23/2012