jQuery is most widely used javascript library around the globe. Many of the biggest sites on the planet use jQuery. Everyone is talking about jQuery.
Here are plenty of good reasons to use jQuery instead plain old javascript or any other library.
- jQuery is cross browser: if you write a piece of code then you are not sure that whether it will run in all browsers are not because every browser has different implementation of javascript. But jQuery makes your life easier by handling all this cumbersome task and provides you a consistent API for all browsers.
- jQuery supports AJAX: Ajax is a technique to fetch or post data to the server without refreshing the page. jQuery does it in a very simple and clean way.
- jQuery supports CSS selectors: Before jQuery it was very difficult to search the elements on the page. But jQuery makes this task easier. Now you can select elements on the page using id, class and even using css selectors and then you can perform various actions on the selected elements.
- jQuery handles Page Load very well: Some time we need to perform a javascript task when page is loaded. We can write this code window’s onload event but it occurs when page is fully loaded. If we use jQuery’s handling of page load then it will run our code as soon as possible without waiting for all the images downloaded fully.
- jQuery lets you create HTML: Using jQuery you can add HTML code to an element ( simple html content or html elements) easily.
- jQuery supports animation and effects: You can bring life to your pages very easily by using jQuery. You can provide visual effects ( fade in and fade out etc.) to your HTML elements.