Unable to run Jquery from local folder

断了今生、忘了曾经 提交于 2019-12-02 15:06:28

Include in your head tag:

<!-- jQuery -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>

Like:

<head>
  <!-- jQuery -->
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>

Include head tag

<html>
<head>
      <!-- jQuery -->
      <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
</body>
</html>

You can use like this.

<head>
     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">/script>
</head>
<body>
<p></P><input type=button value="Click me" id="btn1"/>

  <script>

  $('#btn1').click(function()
  {
      $('p').html("Hello World!");
  });

  </script>
</body>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!