jQuery keyup() Method - CodingTag

jQuery keyup()


  • This jQuery function is worked when the keyup event occurs or it binds a function to run when a keyup event occurs.
  • A keyup event happens when a keyboard key is released after pressing.
  • There are two other events are present in jquery that is related to keyup event.

1 keydown: This event happens when a keyboard key is on its way down.

2 keypress: This event happens when a keyboard key is pressed down.

Related Topics:

jQuery bind
jQuery unbind

jQuery keyup()


$(selector).keyup() ;


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


Parameter description:

  • function: It represents the function to run when the keyup event is triggered. It is optional.


<title> jQuery Example </title>
<script type = "text/javascript"
i = 0;
$(this).css("background-color", "pink");
$(".st2").text(i += 1);

$("body").css("background", "gray");


<h2> jQuery Keyup Event Example </h2>
Name: <input class="name" type="text" name="fullname"><br>
<strong class="st1"></strong><br>
Length: <strong class="st2">0</strong>


After, enter a name,

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