i am trying to get rid of jQuery in my projects but i ran into an issue: editing CSS styles with vanilla js. in jQuery there is a function$("#anything").css("color", "red");
. What is the equivalent of this function in vanilla JavaScript?
Asked
Active
Viewed 203 times
-1

Mats van Veghel
- 9
- 4
-
[`Element.style`](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Using_dynamic_styling_information#modify_an_elements_style) – Rory McCrossan Feb 17 '22 at 09:26
-
1https://youmightnotneedjquery.com/#set_style – freedomn-m Feb 17 '22 at 09:28