❮ Previous Next ❯

Add jQuery to Your Web Page
There are many ways to use jQuery on your web site, like:

jQuery Download
There are two versions of jQueryfor downloading available at jQuery.com:

The jQuery library is a single JavaScript file, and you reference it with the HTML <script> tag (notice that the <script> tag should be inside the <head> section), for example:
<head>
<script src="jquery-1.12.4.min.js"></script>
</head>
Note: The downloaded file should be placed in the same directory as the pages where you want to use it.

jQuery CDN

If you don't want to download and host jQuery, you can include it from a CDN (Content Delivery Network).
Both Google and Microsoft host jQuery.
To use jQuery from Google or Microsoft, use one of the following:

Google CDN:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("p").hide();
    });
});
</script>
</head>
<body>

<h2>This is java8s.com site</h2>

<p>This is an online tutorial site.</p>
<p>This is for Students, Professors and Developers.</p>

<button>OK</button>

</body>
</html>

Output

pic

Microsoft CDN:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.2.min.js">
</script>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("p").hide();
    });
});
</script>
</head>
<body>

<h2>This is java8s.com</h2>

<p>This is an on-line tutorial site.</p>
<p>This site is for Students, Professors and Developers.</p>

<button>OK</button>

</body>
</html>

Output

pic

 

❮ Previous Next ❯



  Tutorials

Popular Links

Contact Us

address Plot No-N6/530,2ND Floor
Nayapalli,Jayadev Vihar
      Bhubaneswar-751015
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved