Section 25.179. Input.onclick: event handler invoked when a form element is clicked


25.179. Input.onclick: event handler invoked when a form element is clicked

DOM Level 2 Events

25.179.1. Synopsis

 Function onclick 

25.179.2. Description

The onclick property of an Input object specifies an event-handler function that is invoked when the user activates the input element. This is typically done by clicking the element with the mouse, but the onclick handler is also triggered when the user activates the element using keyboard traversal. The onclick handler is not invoked when the click( ) method is called for the element.

Note that the input elements of type "reset" and "submit" perform a default action when clicked: they reset and submit, respectively, the form that contains them. You can use the onclick event handlers of each element to perform actions in addition to these default actions. You can also prevent these default actions by returning false or by using the other event-cancellation techniques described in Chapter 17. Note that you can do similar things with the onsubmit and onreset event handlers of the Form object itself.

25.179.3. See Also

Element.addEventListener( ); Chapter 17




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net