🌐jQuery
Also known as jQuery Library, $(), jQuery JS
A JavaScript tool that makes it quick to find and change parts of a web page.
Think of it like
It is like a remote control for the page. One short press does a long job.
Example
Lucy takes over an old shop site. Its code is full of $(...) calls, so she learns enough jQuery to fix the menu.
Why it matters
You will meet it in a huge number of older sites. Knowing it helps you read and fix them.
Definition
Example code
javascript
$(".btn").on("click", function () {
$("#menu").toggle();
});Common mistake
Key takeaways
- 1Find with $. Pass a CSS selector to $().
- 2Short calls. One line hides, shows or changes.
- 3Common in old sites. New sites rarely need it.