The click, mouseDown, and mouseUp Events

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email

The click event detects the user pressing a button on a form. You can also use it to detect users clicking hyperlinks or other elements on the page depending on the document object model that the browser is using. The click event is typically used in the following form.

<INPUT type = "button" value = "Calculate Total" onClick calculate Total 0 ">

When the user clicks the button, the event is handed off to the function, where the values from the form are totaled. You'll recall that keyPress is a combination of keyDown and keyUp. The same is true for click and its two companions, mouseDown and mouseUp. The three mouse click events also use the modifiers property, which identifies any of the special purpose keys that the user holds down during the click or release operation.

Example:

<HTML>
<HEAD>
<script language="javascript">
function going()
{
return confirm("Do U really want to leave me?",);
}
</SCRIPT> </HEAD>
<a href="sun;com" onClick="return going()">HeIIo</a>
</HTML>

The onClick event handler is used in a slightly different form with hyperlinks. Instead of simply performing processing, this invocation expects a value true or false.



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.