Register Login

jQuery

What is jQuery?

jQuery is a versatile, fast and succinct JavaScript library. It is not a programming language; jQuery is a cross-platform JavaScript library that contains a collection of protocols for operating JavaScript. jQuery was created in 2006 with the motto- Write less, do more and does exactly the same. It simplifies HTML scripting on the client side and also wraps common tasks into a single method that can be called with a one-line JavaScript code. The feature-rich framework of jQuery makes it easier for the developers to work with relatively complicated things like AJAX interactions, HTML document traversal and DOM manipulation.

jQuery Features

jQuery has a very powerful interface with a host of important features.

DOM Manipulation: You can select DOM elements and modify their content using Sizzle, an open-source selector engine that is browser independent. You can add and remove elements, modify CSS class, HTML content etc.

DOM Selection: jQuery lets the developers retrieve DOM elements on the basis of existing CSS selectors and also provides some custom selectors that can retrieve elements based on a variety of criteria.

AJAX Support: jQuery helps developers to build an interactive platform using AJAX functions. The AJAX technology also allows the loading of data even when the whole page is not being reloaded.

Event Handling: jQuery captures a wide array of events that are parallel to a number of DOM events like dblclick, click, mouseenter, blur, keydown, keyup, mouseleave. These events equip jQuery to deal with any cross-platform issue.

Special Effects: jQuery has a number of built-in effects like animation, sliding effect, hiding elements, fade-out or fade-in of visibility etc.

Cross-browser Support: jQuery works across browsers like Chrome 9.0+, IE 6.0+, Opera 9.0+, Safari 3.0+, FF 2.0+ etc.

Lightweight: jQuery is a very small and efficient library that is just about 19 kb in size.

Latest Technology: jQuery supports basic XPath Syntax and CSS3 Selectors.

Advantage of jQuery

One may wonder what the actual purpose of jQuery is and what difference does it make on using jQuery instead of JavaScript/AJAX. The simple answer is that jQuery combines the best of both worlds to help simplify the developer's job and improves the user experience by providing responsive platforms.

jQuery is an extremely fast and extendable library that facilitates the writing of JavaScript function codes in the least number of lines possible. This ensure an application's improved performance across browsers as jQuery is browser-independent. The online API documentation is excellent with jQuery.

jQuery is more popular than any other JavaScript framework and is used by some of the biggest web companies in the world like Google, Microsoft, Netflix, IBM and others.

What should you know before starting to learn jQuery?

You should start learning jQuery only after you have a fundamental understanding of HTML, CSS and JavaScript.

HTML, CSS and JavaScript are all front-end technologies that are responsible for the design, display and other important aspects of webpages. HTML and CSS work best in tandem with each other and only after you have learned these two, you can learn JavaScript and understand how DOM is a part of the language. jQuery provides a set of practices and conventions that will make operating the front-end technologies much easier for the developers.

How to use jQuery?

There are two ways in which you can use jQuery- Local Installation and CDN based version.

Local Installation: You can install the JavaScript library locally on your machine by downloading the latest version from here and then include it in the HTML file.

CDN Based Version: In this process, you do not need to install jQuery locally on your machine. You can directly include it in your HTML code from the Content Delivery Network (CDN).

Read here jQuery Interview Questions and Answer


Tutorials

  • Uncaught ReferenceError: $ is not defined
    While programming in JavaScript, jQuery or Angular JS, coders often encounter an error called Uncaught ReferenceError: $ is not defined. This usually happens when the $, that may be a variable or a me ...

  • How can I scroll to an Element Using jQuery?
    Using websites and web applications have become a usual technological tool for our daily life. It also happened that in the website, we wanted to scroll automatically to any particular section of the ...

  • Disabling and enabling buttons with jQuery
    Disabling and enabling features in buttons is one of the most useful features every web application uses in its buttons. It uses JavaScript along with jQuery and depending on a specific condition ...

  • Add, Remove & Toggle CSS Class from an Element with jQuery
    As in JavaScript, users have used the classList.remove() function to remove a CSS class. Also, using jQuery, users can remove a single class, multiple classes, or every class from the selected HTML el ...

×