<html>
<body>
<p id="myP">This is a paragraph.</p>
<button type="button" onclick="myFunction()">Set font</button>
<script>
function myFunction() {
document.getElementById("myP").style.fontFamily = "Impact,Charcoal,sans-serif";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_fontfamily by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:06:11 GMT -->
</html>