Selecting one or several DOM elements to do something with is one of the most basic elements of jQuery. The equivalent toย $()
ย orย jQuery()
ย in JavaScript isย querySelector()
ย orย querySelectorAll()
, which, just like with jQuery, you can call with a CSS selector.
// jQuery, select all instances of .box
$(".box");