## Examples
This example uses the onchange event to retrieve the selected option of a select object.
<body>
<form>
<p>Select a different option in the drop-down list box to trigger the onchange event.
<select name="selTest" onchange="alert('Index: ' + this.selectedIndex
+ '\nValue: ' + this.options[this.selectedIndex].value)">
<option value="Books">Books</option>
<option value="Clothing">Clothing</option>
<option value="Housewares">Housewares</option>
</select> </p>
</form>
</body>
Notes 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 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:
The pEvtObj parameter is required for the following interfaces:
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4