EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

onchange event

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

HTML 4.01 Specification, Section 18.2.3

Syntax

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

Event information

SynchronousNo
BubblesNo
CancelableYes

Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

Standards information

Remarks

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 HTMLTextContainerEvents2::onblur when the control is also losing the focus.

The HTMLTextContainerEvents2::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

HTMLTextContainerEvents2::onkeypress

 

 

커뮤니티 추가 항목

추가
표시:
© 2014 Microsoft. All rights reserved.