jQuery监听多键按下的实例

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_21891743/article/details/83411340
<!doctype html>
<html lang="en">
 <head>
  <meta name="Description" content="">
  <title>jQuery监听多键按下的实例</title>
  <!--引入js-->
  <script src="http://libs.baidu.com/jquery/1.7.0/jquery.min.js"></script>
 </head>
  <body class="body">
  <input class="input_01" />
  <input class="input_01" />
  <input class="input_01" />
  <input class="input_01" />
  <input class="input_01" />
  <input class="input_01" />
  <script>
    $('.input_01').keydown(function(e){
        if (e.ctrlKey && e.keyCode == 65)
        {
            $('.input_01').val($(this).val());
        }
    });
 </script>
  
 </body>
</html>

在其中一个文本框里面输入内容,然后按下Ctrl+A,可以将文本复制到其他输入框中

猜你喜欢

转载自blog.csdn.net/qq_21891743/article/details/83411340