onblur Event in JavaScript
onblur Event in JavaScript
The onblur event fires the moment that the element loses focus. Onblur is most often used with form validation code. It is applicable to all HTML Elements. Its opposite event is onfocus. In this, the element gets focused.
Syntax:-
Its syntax is:- < anyElement onblur="my_script" > OR object.onblur= function(){my_script} OR object.addEventListener("blur", my_script)