Saturday, July 6, 2019

JQuery

Image result for Jquery
jQuery is a JavaScript Library.  jQuery greatly simplifies JavaScript programming. 

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.
jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.
jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation

The jQuery library contains the following features:

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

Why jQuery?
There are lots of other JavaScript frameworks out there, but jQuery seems to be the most popular, and also the most extendable.


Many of the biggest companies on the Web use jQuery, such as:

  1. Google
  2. Microsoft
  3. IBM
  4. Netflix

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

 jQuery from a CDN

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>


jQuery Syntax

The jQuery syntax is tailor-made for selecting HTML elements and performing some action on the element(s).
Basic syntax is: $(selector).action()

  • A $ sign to define/access jQuery
  • A (selector) to "query (or find)" HTML elements
  • A jQuery action() to be performed on the element(s)Examples:
  1. $(this).hide() - hides the current element.
  2. $("p").hide() - hides all <p> elements.
  3. $(".test").hide() - hides all elements with class="test".
  4. $("#test").hide() - hides the element with id="test"

No comments:

Post a Comment

Express

In this tutorial, we will also have a look at the express framework. This framework is built in such a way that it acts as a minimal an...