onfocusout Event in JavaScript
onfocusout Event in JavaScript
The onfocusout event is used to occur when an element is about to lose focus. It is similar to onblur event but the main difference is that onblur event does not bubble. So, if we want to figure out whether or not an element or its child loses focus, we should use the onfocusout event. Its the opposite of onfocusin event.
Syntax:-
Its syntax is:- < anyElement onfocusout="my_script" > OR object.onfocusout= function(){my_script} OR object.addEventListener("focusout", my_script)