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