Return the font of a <p> element:
alert(document.getElementById("myP").style.fontFamily);
<!DOCTYPE html> <html> <body> <p id="myP" style="font-family:Arial,Helvetica,sans-serif;"> This is a paragraph, shown in the Arial font.</p> <button type="button" onclick="myFunction()">Return font</button> <p id="demo"></p> <script> function myFunction() {/* w w w .j a va 2 s .co m*/ document.getElementById("demo").innerHTML = document.getElementById("myP").style.fontFamily; } </script> </body> </html>