search

Home  >  Q&A  >  body text

javascript - I downloaded the jQuery file from the official website, but it cannot be run. Why?

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() { //显示错误
$("button").click(function() {
$("p").hide();
});
});
</script>
</head>

<body>

<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">Click me</button>

</body>
</html>

淡淡烟草味淡淡烟草味2768 days ago737

reply all(1)I'll reply

  • 某草草

    某草草2017-05-19 10:23:31

    Although I have never used itsublime, 但是它只是个编辑器啊, 他的jquery plugin应该只是有语法提示功能吧, 你要运行js还是要在解释器里运行的(比如浏览器), 这时候你需要jquery.js

    reply
    0
  • Cancelreply