<html>
<body>
<p id="demo">This is a paragraph.</p>
<button type="button" onclick="myFunction()">Set font</button>
<script>
function myFunction() {
document.getElementById("demo").style.font = "italic bold 20px arial,serif";
}
</script>
</body>
</html>