Introduction
This article is mainly for those developers who are new to web development. People who start their careers usually question - why jQuery while there is JavaScript, or the difference between JavaScript and jQuery; which is better to use - JavaScript or jQuery; is jQuery an alternative for JavaScript, or will jQuery replace JavaScript etc?
Let us first look at what is JavaScript and what is jQuery.
What is JavaScript?
JavaScript (JS) is a dynamic programming language. It is an interpreted language. Other than the unfortunate similarity in name, it has nothing to do with Java programming language. As the name suggests, JavaScript is a scripting language.
It is most commonly used for appealing UI (like moving objects and flashy elements on the screen), user interactions (client-side validation, showing pop-ups etc.), and for controlling the document content displayed to the user.
There is nothing you need to include in the browser to support JavaScript. This is because it was considered the language of the web since its birth. It runs in all modern browsers without any additional plugins.
What do you mean by JavaScript being dynamic?
Most programming languages have dynamic behaviors. But in the case of JavaScript, pretty much everything is dynamic.
All variables are dynamic in type and existence. You declare a variable as,
var msg = "Hello World!";
The code written in JavaScript is dynamic, you can create a variable at runtime, and the type is determined at runtime.
You can create new functions or replace existing functions at runtime.
New codes are added to the browser when more script files are loaded, and you can add any number of files at any time.
What is jQuery
The jQuery website defines jQuery (jQ) as “a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.”.
jQuery is not a programming language instead, it is a cross-platform JavaScript library. There are many other JavaScript libraries available, like MooTools, Knockout, or even Angular (Though Angular uses TypeScript, it compiles to JavaScript at the end), and jQuery is one of the most popular among them.
jQuery is a fast, feature-rich JavaScript library. It is created to help programmers with creating a familiar UI and take care of browser compatibility issues more efficiently.
jQuery, in fact, is nothing but JavaScript. All the code you write in jQuery is converted to JavaScript internally. One line of code written using jQuery may be equal to many lines of code written using JavaScript which means programmers will have to write only lesser lines of code.
To start using jQuery on your page, you need to include one line of code in the header of your page, like,
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script >
The above line includes a jQuery library for your page using the Microsoft CDN (Content Delivery Network). The jQuery library is a single JavaScript file.
You can also include the jQuery library as a local resource from your project folder.
But there are benefits to using the CDN. If you use the minified library version, you will get the advantage of concurrent connections and multiple servers.
JavaScript Vs. jQuery
Now, we can discuss the questions mentioned at the beginning of this article. Most of those questions may arise because of the lack of a clear understanding of JavaScript and jQuery.
Since jQuery is nothing but a library of JavaScript, it cannot replace JavaScript. All jQuery code is JavaScript, but jQuery doesn’t include all the JavaScript code.

Raymond OpriyePosted Nov 16, 2021, 11:14 AM
Very helpful
William McDonaldsPosted Oct 1, 2018, 2:37 AM
Do I need to learn javascript first in order to master JQuery?
Montaz Meah IIPosted Aug 25, 2018, 11:32 AM
$(“.simple-li”)
Farhan AhmedPosted Jul 24, 2018, 4:17 AM
Nice.......
Marvin So YoungPosted Jun 23, 2018, 6:00 AM
So meaning, i can learn JQuery without learning Javacript? Right?
Rakesh BiswalPosted Mar 25, 2018, 7:55 AM
Really helpful for the beginners..
Vishal PrajapatiPosted Jan 12, 2018, 8:01 AM
Nice explanation sir...Thanks for sharing...:)
Sagar Pandurang KapPosted Jan 12, 2018, 12:39 AM
Very well explained.Thanks a lott.Infomative and helpful.
Naresh SinghalPosted Jan 11, 2018, 11:27 PM
Nicely Explained with detailed Dennis Thomas