JavaScript – Change the Font Family of Paragraph

To change the font family of a paragraph using JavaScript, get the reference to the element, and assign the specific font family value to the element.style.fontFamily property.

Example

Conclusion

In this JavaScript Tutorial, we learned how to change the font family of a paragraph using JavaScript.