Multiple selectors allow you to select more than one type of element at the same time.
This helps reduce code and perform actions on different elements together.
Multiple selectors are separated by commas, similar to CSS.
This code selects all paragraph and heading elements together.
Both elements will receive the same style.
This example selects an element by ID and elements by class at the same time.
Multiple selectors are useful when handling different elements with one action.
This code applies the same style to multiple form elements.
Very common in form design and validation.
Multiple Selector Rules:
- Separate selectors using commas
- Can mix ID, class, and elements
- Helps reduce repeated code
- Improves performance and readability