Get the font of a <p> element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:fontFamily


Get the font of a <p> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<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>

function myFunction() {/*from  www  .  jav  a  2s. c  om*/


Related Tutorials