+ 2

Are css values and its syntax seen as objects by javascript

4th Jul 2019, 5:12 PM
Kiro Cosmos
Kiro Cosmos - avatar
1 Answer
+ 3
If I understand your question, no. HTML elements have a style property, where you can change its properties, but you can't manipulate the CSS itself. You can imitate CSS with JS though: CSS: .red { background: red; } JS: for (let i of document.querySelectorAll(".red").forEach(i => {i.style.background = "red"});
4th Jul 2019, 5:28 PM
Airree
Airree - avatar