-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
  • 53,704
  • 14
  • 91
  • 128