How can the style/class of an element be changed?
0
It can be done in the following way:
document.getElementById("myText").style.fontSize = "20";
or
document.getElementById("myText").className = "anyclass";
Sign in to add a comment
0 Answers
0
📝 No answers yet!
Be the first to answer this interview question.
Your Answer
Sign in to post your answer and help the community.