jQuery keyup method triggers when you release the pressed key. You can attach functions to execute when this event occurs.
The order of events related to the keyup event:
Ø keydown - The key is on its way down
Ø keypress - The key is pressed down
Ø keyup - The key is released
|
The keyup event occurs when a keyboard key is released.
Syntex:-
$(selector).keyup()
|
Example :
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(document).ready(function(){
$("input").keydown(function(){
$("input").css("background-color", "blue");
});
$("input").keyup(function(){
$("input").css("background-color", "red");
});
});
</script>
</head>
<body>
Write something inside textbox: <input type="text">
</body>
</html>
|