The jQuery keyup() method triggers the event when keyboard key is released. Bind the event to input field on focus of the input element.
Syntax
The syntax of this method which are given below:-
Syntax to get the keyup event on an element
$(selector).keyup(function(){
//add action here
});
//add action here
});
Description of the Parameters
The description of the parameters are given below.
Parameter Name | Description |
---|---|
selector | The selector is used to select the input element in which keyup is occur on focus. |
Examples of jQuery Keyup() Method
To get the value of input field on keyboard key is released on it, use the example given below.
Example 1
Test it Live
1 2 3 4 5 6 7 8 |
<script> $(document).ready(function(){ $('input').keyup(function(){ var myvalue = $(this).val(); alert(myvalue); }); }); </script> |
You may also like to read