Aral Code

jQuery Tutorial

jQuery is a small JavaScript library that made web development much easier in its time. Its motto is "write less, do more": one short line of jQuery often replaces several lines of plain JavaScript. It's still used on millions of websites, including many WordPress themes and older school and business systems.

This free course has 10 lessons. Every example runs live: press Try it yourself and edit the code.

Should you still learn jQuery?

For new projects, modern JavaScript can do almost everything jQuery does, and frameworks like React are popular for bigger apps. But you'll meet jQuery whenever you maintain an existing site, customize a WordPress theme, or work on a system built a few years ago. Knowing it is a practical skill, and it's quick to learn once you know JavaScript.

Before you start

You should know basic HTML, CSS selectors and some JavaScript (variables, functions and events).

All lessons

Getting Started

  1. Introduction to jQueryWhat jQuery is, how the $ function works, how jQuery compares with plain JavaScript, and your first jQuery code.
  2. Getting Started with jQuery — Adding It and document readyAdd jQuery to a page from a CDN or a downloaded file, run code when the page is ready with $(function), and avoid conflicts and loading-order mistakes.

Basics

  1. jQuery Selectors and FiltersSelect elements with jQuery using CSS selectors, attribute selectors, jQuery filters like :first, :even, :visible and :checked, and methods like .eq, .filter and .not.
  2. jQuery Events — on, click, input and Event DelegationHandle events in jQuery with .on() — click, dblclick, input, change, submit, keyup and hover — use the event object, prevent default actions, and delegate events for dynamic elements.
  3. jQuery Effects — hide, show, fade, slide and animateShow and hide elements with jQuery effects — hide, show, toggle, fadeIn, fadeOut, slideUp, slideDown, slideToggle and animate — with speeds and callbacks.

Changing the Page

  1. jQuery — Getting and Setting Text, HTML, Values and AttributesRead and change content with jQuery — text(), html(), val(), attr(), prop() and data() — with a live form preview and a theme switcher.
  2. jQuery — Adding, Removing and Styling ElementsCreate and insert elements with append, prepend, before and after, remove and empty them, change styles with css, and toggle classes with addClass, removeClass and toggleClass.
  3. jQuery Traversing — parent, children, find, siblings and eachMove around the DOM tree with jQuery — parent, closest, children, find, siblings, next and prev — and loop over matched elements with each.

Going Further

  1. jQuery AJAX — Loading and Sending Data Without ReloadingLoad and send data in the background with jQuery AJAX — $.getJSON, $.ajax, $.post and serialize — handle loading states and errors, and see the modern fetch equivalent.
  2. jQuery Final Project — A Class To-Do AppBuild a complete to-do app with jQuery — add, complete, edit and delete tasks, filter them, show counts, use event delegation and effects — plus how to save tasks with localStorage.