Home
Run >
<!DOCTYPE html> <html> <head> <!-- www.techstrikers.com --> <title>My first Javascript code</title> </head> <body bgcolor="#bnde45"> <fieldset> <legend>Javascript Blur Event</legend> <script type="text/javascript"> function valid(form){ var input=10; input=document.myform.data.value; if (input<10){ alert("Please input a value that is less than 10"); } } </script> <H3> Example of onBlur Event Handler</H3> Try inputting a value less than 10:<br> <form name="myform"> <input type="text" name="data" value="" size=10 onBlur="valid(this.form)"> </form> </fieldset> </body> </html>