How can the style/class of an element be changed?

Asked: Apr 14, 2023

It can be done in the following way:
document.getElementById("myText").style.fontSize = "20";
or
document.getElementById("myText").className = "anyclass";

Asked by brijesh

Answers (0)

No answers yet. Be the first to answer!