How to attach a blur event to an element in jQuery- .blur()

jQuery events methods are used to specify the behavior of the html element when user interacts with the web page contents.
To attach blur event to an element, blur() method can be used that fires when the element loses focus.

$("#txtBlur").blur(function () {
alert("blur handler called");

Above code will execute when user will leave the focus from the “txtBlur” textbox.

Enjoyed this post? Share it!


Leave a comment

Your email address will not be published.