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/EmVmbZ?editors=1010
🔗 Resource: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Properties_Reference
🐦 Beau Carnes on Twitter: https://twitter.com/carnesbeau
⭐JavaScript Tutorials Playlists⭐
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶Clean Code: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkK24EaPurzMq0-kw5U9pJh
–
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
source
Thank you very much! Great explanation! 💛
how can we change the style of ::before and ::after pseuodo elements?
Can you make a script that will make a list of computed styles that are not matched with inline styles?
i think you are a great coder
Amazing! Thanks a lot!
Fantástico. Muito bom!
Good video…they way he pronounced "attribute" for CSS was throwing me off too
What code editor are you using?
I'm far from a grammar nazzie, but http://www.dictionary.com/browse/attribute
the emphasis lays on the first syllable if it's a noun, and on the second syllable (the way you prononced it) if it is a verb.
great tutorial nevertheless. Keep up the good work
freeCodeCamp, what font are you using?
I know this is JavaScript, but having to toggle a class is easy using jQuery:
$('#attribute').css("background", blue);
That being said, I didn't know about setAttribute and I can't wait to use it. Thanks for the great series on JavaScript!
very cool lesson, I didn't know this feature