Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project









CORE ATTRIBUTE:  onclick

onclick="action"
Available in versions: 4.0
HTML 4.0 tag compatibility: All tags except applet, base, basefront, bdo, br, font, frame, frameset, head, html, iframe, isindex, meta, param, script, style, title
 
The onclick core attribute is an event handler that is associated with the single click of a mouse on a selected HTML tag (element). Whenever you single click the element, the script code of the onclick is executed. This script can also call functions or subroutines which contain code that you want to run when the single click occurs.
 
The similar ondblclick core attribute is an event handler that is associated with the double click of a mouse.
 
In this example, every time you single click on the button element, one line of JavaScript code is executed which causes an alert box to be displayed with a message.
 
Code:
<input type="button" onclick="JavaScript: alert( 'onclick event' )" value="Click On This Button">
 
Output:


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information