JavaScript – Change the Font Weight of Div

To change the font weight of a div using JavaScript, get reference to this div element, and assign required font weight value to the element.style.fontWeight property.

example.html

Conclusion

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