javascript fontStyle property


  Translation results:

UK [fɔnt stail] US [fɑnt staɪl]

n.glyph

javascript fontStyle propertysyntax

Function:Set the font style.

Syntax: Object.style.fontStyle=normal|italic|oblique

javascript fontStyle propertyexample

<html>
<head>
<script type="text/javascript">
function setFontStyle()
{
document.getElementById("p1").style.fontStyle="italic";
}
</script>
</head>
<body>

<p id="p1">This is an example paragraph.</p>

<input type="button" onclick="setFontStyle()" 
value="Change font-style" />

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance

Home

Videos

Q&A