<input type="text" onfocusout="myFunction()"> <script> function myFunction(){ console.log("Focus Lost!") } </script>