CSS styles in JavaScript (setting and getting) - Beau teaches JavaScript

Опубликовано: 26 September 2026
на канале: freeCodeCamp.org
40,828
697

How to set CSS properties and styles in JavaScript. Also how to get CSS.

This video covers style, cssText, setAttribute, and getComputedStyle.

💻 Code: https://codepen.io/beaucarnes/pen/EmV...

🔗 Resource: https://developer.mozilla.org/en-US/d...

🐦 Beau Carnes on Twitter:   / carnesbeau  

⭐JavaScript Tutorials Playlists⭐
▶JavaScript Basics:    • JavaScript Basics Course  
▶Data Structures and Algorithms:    • Data Structures and Algorithms - Beau teac...  
▶Design Patterns:    • Design Patterns - Beau teaches JavaScript  
▶ES6:    • ES6 - Beau teaches JavaScript  
▶Clean Code:    • Clean Code - Beau teaches JavaScript  

-
We're busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.

Join our community at https://freecodecamp.com
Read great tech articles at https://medium.freecodecamp.com

❤️ Support for this channel comes from our friends at Scrimba – the coding platform that's reinvented interactive learning: https://scrimba.com/freecodecamp