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

Submitted by: Muhammad
It can be done in the following way:

JavaScript

document.getElementById("myText").style.fontSize = "20?;
or
document.getElementById("myText").className = "anyclass";
Submitted by: Muhammad

Read Online Expert Developer JavaScript Job Interview Questions And Answers