what is Jquery?

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

Tip: In addition, jQuery has plugins for almost any task out there.

example of Jquery

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:

$(this).hide() – hides the current element.

$("p").hide() – hides all <p> elements.

$(".test").hide() – hides all elements with class=”test”.

$("#test").hide() – hides the element with id=”test”.

Are you familiar with CSS selectors?

jQuery uses CSS syntax to select elements. You will learn more about the selector syntax in the next chapter of this tutorial.

Tip: If you don’t know CSS, you can read our CSS Tutorial.


The Document Ready Event

You might have noticed that all jQuery methods in our examples, are inside a document ready event:

$(document).ready(function(){

  // jQuery methods go here…

});
Also Show in Video 
 
 
*** High Salary Job ***

About Vinod Chaudhary

Vinod Chaudhary is a Bachelor's Degree graduate and a co-founder of 91josb.net. Besides being the news of a job he is also a die-hard Arsenal fan.

View all posts by Vinod Chaudhary →

One Comment on “what is Jquery?”

Comments are closed.