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

n.glyph

javascript fontStyle property syntax

Function:Set the font style.

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

javascript fontStyle property example

<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