Thanks for improving this jQuery 4 cheat sheet. Keep changes factual, short, and useful for beginners.
- Verify API behavior against official jQuery documentation before editing examples.
- Use jQuery 4-safe examples.
- Do not add removed APIs except inside the removed API section.
- Prefer short examples that show one concept.
- Use explicit CSS units in
.css()and.animate()examples. - Mark each entry with one
jquery4Status:current,changed,removed, orcaution. - Include an official jQuery URL for every entry.
Edit data/jquery-4-cheatsheet.json for content changes.
{
"id": "events-on",
"title": "Attach an event handler",
"syntax": ".on(events[, selector], handler)",
"example": "$(\".save-button\").on(\"click\", function () {\\n $(this).text(\"Saving...\");\\n});",
"notes": ".on() is the main event API for current jQuery code.",
"jquery4Status": "current",
"replacement": "",
"officialUrl": "https://api.jquery.com/on/"
}Run:
npm run validateReview the Pages site locally:
npm run serveOpen http://localhost:4173 and check search, filters, copy buttons, dark mode, and mobile layout.