JavaScript

Tuesday April 8, 2025
updated: April 10, 2002

 
Home
Getting Started
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Resources
Credits

 

 


   Lesson 7 Example 4: OnBlur call addCheck Function

Email Adress: Name:

This code calls the function:

Enter Email Adress: <input type="text" value="" name="userEmail" onBlur=addCheck()>
<input type="button" value="submit">

This code defines the function:

<script language="javascript">
function addCheck() {alert("Please check email details are correct before submitting")}
</script>

In this example, the onBlur event handler executes the alert command on when the form element loses focus. This occurs when the user clicks outside the form or uses the TAB key.

The onBlur is also an event handler for: Button, Checkbox, FileUpload, Layer, Password, Radio, reset, Select, Submit, Text, TextArea, Window.

 


© 2002 Tracy Johnson