JavaScript – Change Paragraph Text to Bold
To change paragraph text to bold using JavaScript, get the reference to the paragraph element, and assign element.style.fontWeight
property with value of "bold"
.
Example
Conclusion
In this JavaScript Tutorial, we learned how to change text in a paragraph to bold using JavaScript.