Tryit Editor v1.4

<html> <head> <script type="text/javascript"> function message() { alert("This alert box was triggered by the onblur event handler"); } </script> </head> <body> <p>The onblur event occurs when an element loses focus. Try to click or write in the input field below, then click elsewhere in the document so the input field loses focus.</p> <form> Enter your name: <input type="text" onblur="message()" size="20"> </form> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself