agyanadda@gmail.com

jQuery Introduction

jQuery Basics 1 min read Updated Dec 1, 2026 Topic 1 of 25

jQuery is a JavaScript library — a file of ready-made functions. Its motto is "write less, do more".

// Plain JavaScript
document.querySelectorAll('.box').forEach(el => el.style.display = 'none');

// jQuery
$('.box').hide();

What can jQuery do?

  • Select and change HTML elements easily
  • Handle events like click, submit and keyup
  • Add effects: hide, show, fade, slide, animate
  • Make AJAX requests to load data without reloading
  • Work the same way in all browsers

Should you still learn jQuery?

Modern JavaScript can do most of what jQuery does, and new projects often use React or Vue. But jQuery is still used on millions of websites — WordPress themes, Bootstrap 4 projects, admin panels, DataTables and many Laravel/PHP apps. Knowing it helps you maintain real projects and get jobs.

This tutorial uses jQuery 3.7.1. Learn basic HTML, CSS and JavaScript first.

Example

Example — Your first jQuery code HTML
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

<h2 id="title">Hello!</h2>
<p class="msg">Click the button to hide this paragraph.</p>
<button id="btn">Hide</button>

<script>
  $(function () {
    $('#btn').click(function () {
      $('.msg').hide();
      $('#title').text('jQuery did that!');
    });
  });
</script>

Test Yourself With Exercises

Exercise 1 Multiple Choice

What is jQuery?

Exercise 2 True / False

jQuery code is still JavaScript.

Exercise 3 Fill in the Blank

The jQuery motto is "write less, do ___".

Frequently Asked Questions

No. It is not the first choice for new single-page apps, but it is actively maintained and still powers a huge share of websites, especially WordPress and older PHP projects.