which
English [wɪtʃ] US [hwɪtʃ,wɪtʃ]
pron. Which; which one; which ones; that, refers to the things mentioned earlier
adj.Which one; which ones
jquery which incident syntax
Function: which attribute indicates which key or button was pressed.
Syntax: event.whic
Parameters:
Parameters | Description |
event | Required. Specifies the events to be checked. The event parameter comes from the event binding function. |
jquery which incident 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(event){ $("div").html("Key: " + event.which); }); }); </script> </head> <body> 请随意键入一些字符:<input type="text" /> <p>当您在上面的框中键入文本时,下面的 div 会显示键位序号。</p> <div /> </body> </html>
Click the "Run instance" button to view the online instance