Hackforge Academy

Category: javascript

jquery introduction and selectors

Published on 30 Sep 2026

Explanation

jQuery is a JavaScript library that simplifies DOM manipulation, event handling, animations, and AJAX operations.

Code:

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

Explanation

Use the $ function to select HTML elements using CSS-style selectors.

Code:

$('#title');
$('.box');
$('p');

Explanation

An ID selector selects a single element using its id attribute.

Code:

<h1 id="title">Hello</h1>

$('#title').text('Welcome');

Explanation

A class selector can select multiple elements that share the same CSS class.

Code:

<p class="item">One</p>
<p class="item">Two</p>

$('.item').css('color', 'blue');

Explanation

jQuery also supports attribute and descendant selectors.

Code:

$('input[name="email"]');
$('.menu li');
$('button[type="submit"]');

πŸš€ Learn Spring Boot with real-world projects

πŸ’‘ Build REST APIs step by step

🧠 Improve backend development skills

🎯 Get career-ready practical training

Join Our Free WhatsApp Community

Direct access to niche-specific mentors and peers on WhatsApp.

🐍

Python Community

Discuss Django, FastAPI, AI integration, and automation scripts with 15k+ developers.

Join Python Community
βš›οΈ

React Community

Master Next.js, Framer Motion, and State Management. Share your latest UI components.

Join React Community
β˜•

Java Community

Deep dives into Spring Boot, Microservices architecture, and high-performance backend ops.

Join Java Community