jQuery

jQuery is a JavaScript Library.

Before you start studying jQuery, you should have a basic knowledge of:

  • HTML
  • CSS
  • JavaScript

What is jQuery?

jQuery is a lightweight, "write less, do more", JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on your website.

Adding jQuery to Web Pages

There are several ways to start using jQuery on your web site. You can:

  • Download the jQuery library from jQuery.com
  • Include jQuery from a CDN, like Google
Adding jQuery Example
<head> <script src="jquery-3.3.1.min.js"></script> or <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head>
  • Download the jQuery library from jQuery.com
  • Include jQuery from a CDN, like Google

What Does jQuery Code Look Like?

jQuery Example
<script> $(document).ready(function(){ $("button").click(function(){ $("p").toggle(); }); }); </script>

The jQuery library contains the following features:

  • HTML/DOM manipulation
  • CSS manipulation
  • HTML event methods
  • Effects and animations
  • AJAX
  • Utilities

What Can jQuery Do?

jQuery behavior Example
This text will be hide and show on click the toggle button


Leave a Comment:

Comment as a guest:

Commenter Name
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin.
Dec 4, 2017 at 3:12 pm
Reply
Commenter Name
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin.
Dec 4, 2017 at 3:12 pm
Reply

Join Us!