Selecting Elements
When we target something using jQuery, it selects every element on the page that matches that selector.
Selecting by class name
Class names in Webflow should not contain spaces, capital letters, or start with a number.
Selecting by class name & combo class
Only selects hero-card elements that have a combo class of is-featured
Selecting an element inside of another element
Only selects dark-card elements that are inside of the hero-grid
Selecting by data attribute name & value
Selecting by html tag
We can target any element by its html tag. If unsure of the tag name, right click on any element & inspect on the published site to find its tag.
Selecting multiple elements
Chaining selectors
We can chain together multiple selectors by using commas to select different elements together.
.add() method
We can also use the .add() method to select multiple elements. This is more useful for selecting multiple elements once they're already saved in separate variables.
Last updated