-1

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?

1 Answers1

0
document.getElementById('anything').style.color = 'red';

See MDN.

connexo
  • 49,059
  • 13
  • 74
  • 108