which

英[w?t?]? ?美[hw?t?,w?t?]??

#pron.哪個;哪一個;哪一些;那,指前面提到的事物

adj.哪一個;哪一些

jquery哪個事件 語法

作用:which 屬性指示按了哪個鍵或按鈕。

語法:event.whic

#參數(shù):

##參數(shù)描述event? ??#必要。規(guī)定要檢查的事件。這個?event?參數(shù)來自事件綁定函數(shù)。? ??

jquery哪個事件 範例

<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>
執(zhí)行實例 ?

#點擊 "執(zhí)行實例" 按鈕查看線上實例

#
<span id="zea8z"><small id="zea8z"></small></span>
  • <thead id="zea8z"></thead>
          <span id="zea8z"></span>