Open In App

How to convert jQuery to JavaScript ?

JavaScript is an object orient programming language designed to make web development easier and more attractive. In most cases, JavaScript is used to create responsive, interactive elements for web pages, enhancing the user experience.

jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript.



Selection: In jQuery, to select any element, we simply use the $() sign, but in JavaScript, to select any element, we can use querySelector() or querySelectorAll().

Some other examples of selectors:



To select the entire html:

To select the entire html body:

Class manipulation:

Below some other examples of manipulation:

To add a class to an html element:

To remove a class to an html element:

To toggle a class to an html element:

To check whether an html element contains a class:

Event Listeners

CSS Styling:

jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, It is widely famous with it’s philosophy of “Write less, do more”.
You can learn jQuery from the ground up by following this jQuery Tutorial and jQuery Examples.


Article Tags :