GlobalEventHandlers.onchange

  • Revision slug: Web/API/element.onchange
  • Revision title: element.onchange
  • Revision id: 414187
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment Remove an incorrect note, replace with a link to the 'change' event documentation which has more complete information about this; also link to 'DOM event handlers'

Revision Content

{{DomRef}}

Summary

The onchange property sets and returns the event handler for the {{event("change")}} event.

Syntax

element.onchange = handlerFunction;
var handlerFunction = element.onchange;

handlerFunction should be either null or a JavaScript function specifying the handler for the event.

Notes

See the DOM event handlers page for information on working with on... handlers.

See the {{event("change")}} event documentation for information about the event.

Revision Source

<div>
  {{DomRef}}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <code>onchange</code> property sets and returns the <a href="/en-US/docs/Web/Guide/DOM/Events/Event_handlers" title="/en-US/docs/Web/Guide/DOM/Events/Event_handlers">event handler</a> for the {{event("change")}} event.</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
<em><var>element</var></em>.onchange = <em>handlerFunction</em>;
var <em>handlerFunction</em> = <em><var>element</var></em>.onchange;
</pre>
<p name="Notes"><code><em>handlerFunction</em></code> should be either <code>null</code> or a <a href="/en-US/docs/JavaScript/Reference/Functions_and_function_scope" title="/en-US/docs/JavaScript/Reference/Functions_and_function_scope">JavaScript function</a> specifying the handler for the event.</p>
<h2 id="Notes" name="Notes">Notes</h2>
<p>See the <a href="/en-US/docs/Web/Guide/DOM/Events/Event_handlers" title="/en-US/docs/Web/Guide/DOM/Events/Event_handlers">DOM event handlers</a> page for information on working with <code>on...</code> handlers.</p>
<p>See the {{event("change")}} event documentation for information about the event.</p>
Revert to this revision