What is JQuery?

jQuery is a JavaScript library that lets you search for elements in a web document using CSS-style selectors and then performing the elements using certain methods. The purpose of jQuery is to make it much easier to use JavaScript on your website. Besides that, jQuery simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

We can create a jQuery function using the $() symbol, as follows:

$(‘li.popular)

This is a CSS-style selector where it finds all the <li>elements with a class of popular.

The jQuery has many methods that we can use to work with the elements we have selected.

For example. we can use the addClass method

$(‘li.popular)