JAVASCRIPT

 Home  Computers & Internet  Web Programming JAVASCRIPT
What is Javascript?
Javascript Placement
Syntax
Reserved Words
Variables
Data Types
Escaping Characters
Concatenation
Arithmetic Operators
Assignment Operators
Comparison Operators
Boolean Operators
Conditional Operator
If Statements
Else If Statements
If Else Statements
Switch Statements
While Loops
For Loops
Do While Loops
Break Statement
Continue Statement
prompt()
alert()
Date()
Event Handlers
String Object Methods
Math Object Methods
Window Object Methods
Arrays

JAVASCRIPT ONMOUSEDOWN EVENT

The javascript onmousedown event handler is used to trigger a script or action when a mouse button is depressed but not released on an element. The onmousedown event calls the action from most elements.

Example:

<a href="#" onmousedown="alert('Jeepers! I\'ve been clicked');">Click this</a>

The above example will output Jeepers! I 've been clicked when you depress the mouse button on the link.

The onmousedown event can also call a function as follows:

<head>
<script type="text/javascript">

function clickme()
{
alert('Jeepers! I\'ve been clicked');
}

</script>
</head>
<body>

<a href="#" onmousedown="clickme();">Click this</a>

DEMO:

Hold your mouse button down over the link below to see the effect.

Click this

See also:

onload
onunload
onclick
ondblclick
onmouseup
onmouseover
onmousemove
onmouseout
onkeypress
onkeydown
onkeyup
onfocus
onblur
onsubmit
onreset
onselect
onchange


Home | Privacy Policy | Terms Of Use | Contact Us