How to use jQuery

We know that jQuery is very fast and light weight JavaScript library which was developed in 2006 with the motto : 'Write less, Do more'. 


How to use jQuery:


    There are 2 ways to include jQuery and use it in the website.
  • Local Installation:
    • For local installation, you can download the jQuery file in your local computer and can include in HTML code.
    • To download the latest version of jQuery: go to the http://jquery.com/download/
    • Now insert the downloaded file in your website's directory. Suppose you have downloaded the jquery-2.2.js and put it into jquery folder then your code to include jquery will be :
               <head> 

                   <title>jQuery Include Example</title>
                   <script type="text/javascript" src="/jquery/jquery-2.2.js"></script>

               </head> 

  • Content Delivery Network Based Version:
    • You can directly put the jQuery file into your library from Content Delivery Network. Google provides this facility for the latest jQuery version.
    • You can also include it via jQuery official site.
             <head> 

                  <title>jQuery Include Example</title>
                  <script type="text/javascript" src="https://code.jquery.com/jquery-2.2.js"></script>

             </head>

Comments