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 ONBLUR EVENT

The javascript onblur event handler is used to trigger a script or action when an element loses focus. The onblur event calls the action from the following elements:

<a>
<area>
<button>
<input>
<label>
<select>
<textarea>
Example:

<input type="text" onblur="alert('Jeepers! I\'ve been touched');"><br>

<input type="text" >

The above example will output Jeepers! I've been touched when you click away after being in the first text box.

The onblur event can also call a function as follows:

<head>

<script type="text/javascript">

function touchme ()
{
alert('Jeepers! I\'ve been touched');
}

</script>

</head>

<body>

<input type="text" onblur="touchme();"><br>

<input type="text" >

DEMO:

Click on the first text box below, then click outside the text box or the second text box to see the effect.





See also:

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


Home | Privacy Policy | Terms Of Use | Contact Us