Navigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0
element.onclick
The onclick() event handler of a form element is invoked by the web browser when the user clicks on the element. Note, however, that it is not invoked when JavaScript calls the click() method of an element.
The onclick() event handler is a function defined through the onClick attribute of the HTML tag that defined the form element. The value of this attribute is a string that may contain any number of JavaScript statements, separated by semicolons. In Navigator 3.0, the onclick() event handler may also be defined by assigning a function directly to the onclick property of an element.
Only form elements that are buttons invoke the onclick() event handler. These are the Button, Checkbox, Radio, Reset and Submit elements. Other form elements use the onchange() event handler instead of onclick().
Note that the Reset and Submit elements perform a default action when clicked: they reset and submit, respectively, the form that they are a part of. You can use the onclick() event handlers of each of these elements to perform actions in addition to these default actions. In Navigator 3.0, you can also prevent these default actions from occurring by returning false. That is, if the onclick() handler of a Reset button returns false, then the form will not be reset, and if the onclick() handler of a Submit button returns false, then the form will not be submitted. Note that you do similar things with the onsubmit() and onreset() event handlers of the Form object itself.
Finally, note that Link object also defines an onclick() event handler.
file: /Techref/language/java/script/definitive/refp_109.htm, 6KB, , updated: 2019/10/14 15:00, local time: 2024/11/15 23:36,
3.135.212.177:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.ecomorder.com/techref/language/java/script/definitive/refp_109.htm"> [Chapter 21] Reference: Element.onclick()</A> |
Did you find what you needed? |
Welcome to ecomorder.com! |
Welcome to massmind.ecomorder.com! |
.