Javascript Form How to - Handle Button focus lost event








Question

We would like to know how to handle Button focus lost event.

Answer



<html>
    <form name="myForm">
      <input type="button"
             value="Big Button"
             name="myButton"
             onBlur="console.log('Blur event occurred')">
    </form>
</html>

The code above is rendered as follows: