Javascript examples for DOM Event:onblur
Creating an element and handle its blur event
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from www . j av a 2 s. co m*/ function foo() { console.log('Works!'); } var inp = document.createElement('input'); inp.onblur = foo; document.body.appendChild(inp); document.body.innerHTML += '<br>'; } </script> </head> <body> </body> </html>