please dont rip this site

JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next
 

Element.onclick() Handler

Name

Element.onclick() Handler---invoked when a form element is clicked

Availability

Navigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0

Synopsis

element.onclick

Description

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.

See Also

"Element", "Element.onblur()", "Element.onchange()", "Element.onfocus()"


Previous Home Next
Element.onchange() Book Index Element.onfocus()

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell

file: /Techref/language/java/script/definitive/refp_109.htm, 6KB, , updated: 2019/10/14 15:00, local time: 2024/11/30 01:10,
TOP NEW HELP FIND: 
3.135.205.26: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?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/Techref/language/java/script/definitive/refp_109.htm"> [Chapter 21] Reference: Element.onclick()</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .