How do you change the style/class on any element using JavaScript?
document.getElementById(“myText”).style.fontSize = “10";
OR
document.getElementById(“myText”).className = “anyclass”;
you can suggest other answer in comment box OR
document.getElementById(“myText”).className = “anyclass”;
Exam: Java Script Interview QUESTIONS
Login to DiscussLogin
Recommended Learning for you
Close(X)
Subscribe here for free mock test on IAS PCS SSC and other competitive exam. Signup here to get SSC CGL Solution and main exam study material