JSFiddle - React, Tailwind, and code Playground

by flowerszhong

HTML

<!DOCTYPE html>
<html>
<head>
    <title>why dblclick trigger keyup</title>
</head>
<body>
  <span>First input a word to ensure keyup handler is availabe.<br>Second please double click the input box below:</span><br>
  <input type="text" name="" value="" id="test">
  <div id="output"></div>
</body>
</html>

CSS

#test,#output{
    margin:30px;
}

JavaScript

$(function (argument) {
    var input = $("#test");
    input.bind("keyup",function(e){
      console.log("keyCode: " + e.keyCode);
      console.log("which: " + e.which);
      var str =   "keyCode: " + e.keyCode +"<br>" +"which: " + e.which +"<br><br>";
      $("#output").append(str);
    });
   })