Javascript examples for DOM Event:Element Event Attribute
The onblur event occurs when an object loses focus.
Bubbles | No |
---|---|
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").onblur = function() {myFunction()}; function myFunction() {/*from w w w.j av a2s . co m*/ console.log("Input field lost focus."); } </script> </body> </html>