Open In App

Why we use jQuery in our web application ?

jQuery is a fast, feature-rich, and lightweight JavaScript library. The main purpose of using jQuery is to make it much easier to use JavaScript on your modern and smart website. It is highly recommended to have a basic knowledge of HTML, CSS, and JavaScript

jQuery was developed to save the time of developers by reducing the code. It takes loads of common duties that require many lines of JavaScript code to perform and wrap them into strategies that you may name with a single line of code.



Reasons to use jQuery in your application:

You might be able to understand by referring to the below example.



JavaScript Code Snippet: 

function changeColor(color) {
    document.body.style.background = color;
}

Onload = changeColor('green');

jQuery Syntax:

$('body').css('background', 'green');

From the above example, you can notice that the JavaScript code is lengthier and complicated than the jQuery code. Both the code are performing the same work of changing the background color but jQuery takes less code. You can work around other examples, which indicates that jQuery minimizes the code and is less complicated to use. 

Article Tags :