- You want items to change in style as people do things, not just when they load.
- While CSS does offer pseudo selectors (ex: hover), they are not numerous and limited.
Two ways to style with JS
- Set a CSS property directly on the element
- Remove or add class values, which can add or take away style rules
- You can select only one by using a class or id and targeting it
- You can select all assigned to a class and write a for loop to change it
Add or Remove Classes
- Can use classList API (see resources for more info)
- Use add or remove
- Useful with CSS that is already set
I also learned more about animation, transitions and transforming with CSS3. I feel like I have a solid grasp on it now and am working on a card flip action that can be used on our group app (a study card app).