jQuery blur() Method - CodingTag

jQuery blur()


  • The blur event of jQuery occurs when an HTML element loses focus. This event most often generated by the mouse click or we can also generate it by keyboard key pressing.
  • The blur() method is used to handle the blur event means this method is used to trigger the blur event or attaches a function to run when a blur event occurs.
  • This method is complimentary of the focus() jQuery method and most of the time both functions are used together.

Related Topic:

jQuery bind
jQuery unbind

jQuery blur




If you want to trigger a function in it, the syntax will be:


Parameter description:

  • function: It represents the function to run when the blur event occurs. It is optional.


In this example, we blur the input field, leave the entering value.

<title> jQuery Example </title>
<script type = "text/javascript"
$(this).css("background-color", "pink");
$(this).css("background-color", "#ffffff");

<h2> jQuery Blur event Example </h2>
Name: <input type="text" name="fullname">


When you start to enter the name value, the color of the input box will change.

When you click outside the input box, the color becomes again white and the box becomes a blur.

Best WordPress Hosting


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price

Leave a Reply

    Waiting for your comments