<html>
<body>
<p id="demo" style="font-style:italic;">This is a paragraph.</p>
<button type="button" onclick="myFunction()">Return font style</button>
<script>
function myFunction() {
alert(document.getElementById("demo").style.fontStyle);
}
</script>
</body>
</html>