JavaScript – Change Text in Div to Italic
To change text in Div to italic using JavaScript, get reference to the div element, and assign element.style.fontStyle
property with value of "italic"
.
Example
Conclusion
In this JavaScript Tutorial, we learned how to change text in a div to italic using JavaScript.