0

CSS and JS question

How can i use JS variables with CSS values? e.g: CSS: color: #090909; JS: var someColor; I want to be able to assign the CSS color though JS

30th May 2018, 11:09 PM
Henry Arch
Henry Arch - avatar
4 odpowiedzi
30th May 2018, 11:39 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
Look at the lessons in JS, your answer lies there....
30th May 2018, 11:38 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
Here a sample to change body css through js: var body = document.body; body.style.backgroundColor = color; https://code.sololearn.com/Wk2i6r9kgwe2/?ref=app
31st May 2018, 1:01 AM
Calviղ
Calviղ - avatar