keyup

Pop up; release the keyboard

jquery keyup() method syntax

Function:The complete key press process is divided into two parts, the key is pressed, and then the key is released and reset. The keyup event occurs when the button is released. It happens on the element that currently has focus. The keyup() method triggers the keyup event, or specifies a function to run when the keyup event occurs. If set on a document element, this event occurs regardless of whether the element has focus.

Please use the .which property to determine which key was pressed.

Trigger the keyup event syntax: $(selector).keyup(

Bind the function to the keyup event syntax: $( selector).keyup(function)

Parameters:

##ParameterDescriptionfunction Optional. Specifies the function to be run when the keyup event occurs.

jquery keyup() method example

<html>
<head>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("input").keydown(function(){
    $("input").css("background-color","#FFFFCC");
  });
  $("input").keyup(function(){
    $("input").css("background-color","#D6D6FF");
  });
});
</script>
</head>
<body>
Enter your name: <input type="text" />
<p>當(dāng)發(fā)生 keydown 和 keyup 事件時(shí),輸入域會(huì)改變顏色。請(qǐng)?jiān)囍谄渲休斎雰?nèi)容。</p>
</body>
</html>
Run instance ?

Click the "Run instance" button to view the online instance

    <thead id="0vvgl"></thead>
  1. <li id="0vvgl"></li>
    <rt id="0vvgl"><small id="0vvgl"></small></rt><bdo id="0vvgl"><meter id="0vvgl"></meter></bdo>

    1. <span id="0vvgl"></span>
  2. <bdo id="0vvgl"><tbody id="0vvgl"></tbody></bdo>