Website Developer Question:
Download Job Interview Questions and Answers PDF
Tell me how Do You Change The Style/Class On Any Element From JavaScript?
Answer:
Following JavaScript will modify the style/class of an HTML element.
document.getElementById(“input”).style.fontSize = “10”;
-or-
document.getElementById(“button”).className = “classname”;
document.getElementById(“input”).style.fontSize = “10”;
-or-
document.getElementById(“button”).className = “classname”;
Download Website Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell us how Do You Add Comments In CSS? | Do you know what Is Scope In JavaScript? |