HTML Interview Questions

Q. How do you change the style of a HTML element
You can change inline style or classname of a HTML element using javascript

Using style property: You can modify inline style using style property
document.getElementById(“title”).style.fontSize = “30px”;
Using ClassName property: It is easy to modify element class using className property
document.getElementById(“title”).className = “custom-title”;


Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
Cloudy | #1 secure, private, and affordable online storage solutions. Privacy, cookie & data policy.