06. Setting Attributes πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ—οΈ Use JavaScript to Set Attributes of HTML Element

Implement the following user story:

  • As a web developer, I want all of my titles on a webpage to have the same styling.

Acceptance Criteria

  • It’s done when all the <h4> elements are selected and stored in a single variable.

  • It’s done when the text of each <h4> is set to blue, the font size is 30px, and the text is bold.

  • It’s done when the padding to the left of the title is set to 10px and the margin is set to 0.


πŸ’‘ Hints

How can you use a loop to iterate over a list of elements?

πŸ† Bonus

If you have completed this activity, work through the following challenge to further your knowledge:

  • How would using the :scope pseudo-class be useful when working withquerySelectorAll()?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here