How to link jQuery from my local machine?


You can add jQuery using CDN or through downloading it on local machine. For Local Installation, download jQuery library on your local machine and include it in your HTML code. The following are the steps:

  • Go to the jQuery website to download the latest version available.
  • Now put downloaded jquery-3.2.1.min.js file in a directory of your website, e.g. /jquery.

You can try to run the following code to learn how to link jQuery from local machine:

Live Demo

<html>
   <head>
      <title>jQuery Example</title>
      <script src = "/jquery/jquery-3.2.1.min.js"></script>
      <script>
         $(document).ready(function(){
            document.write("Hello, World!");
         });
      </script>        
   </head>
   
   <body>
      <h1>Hello</h1>
   </body>
   
</html>

Updated on: 12-Jun-2020

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements