JavaScript Reference/Event Handlers Reference/onChange
Содержание
"onChange" Example
<source lang="javascript">
<head> <script language="JavaScript">
function function1(colors) { var col = (colors.options[colors.selectedIndex].value); if (col) { document.bgColor = col; } alert("The background color has changed to "+col) }
</script></head> <body> <select name="colors" onChange="function1(this)">
<option value="white" selected>White</option> <option value="cyan">Cyan</option> <option value="ivory">Ivory</option>
</select> </body>
</source>
"onChange" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |
</source>
"onChange" Properties
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Properties |altKey altLeft | | |button clientX | | |clientY ctrlLeft | | |offsetX offsetY | | |returnValue screenX | | |screenY shiftKey | | |shiftLeft srcElement | | |type x | | |y | +----------------+--------------------------------------------------------------+
</source>
"onChange" Syntax and Note
<source lang="javascript">
Note:
This event fires when the content of a form element is changed.
</source>