Javascript examples for DOM Event:addEventListener
The onfocusout event occurs when an element is about to lose focus.
Bubbles | Yes |
---|---|
Cancelable | No |
Supported HTML tags: | ALL HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> |
<!DOCTYPE html> <html> <body> <input type="text" id="fname"> <script> document.getElementById("fname").addEventListener("focusout", myFunction); function myFunction() {//from w ww . j a va2 s.c o m console.log("Input field lost focus."); } </script> </body> </html>