The Jquery code is all correct, the result is that the problem solution does not run

Wrote a super simple code

<html>

<head>
<script src="jquery-3.3.1.min.js"></script>
<script type="text/javascript">

  $("#btn").click(function(){
alert("eeeeee");
});  
</script>
</head>
<body>
<input type="button" id="btn" value="点我">
</body>

</html>

As a result, the click did not respond, and there was nothing wrong. There was no response. I wondered for a long time. It turned out that the js was placed in $("document").ready(function() {});

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$("document").ready(function() {
  $("#btn").click(function(){
alert("eeeeee");
});  
});


</script>
</head>


<body>
<input type="button" id="btn" value="点我">
</body>
</html>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324651951&siteId=291194637