font

英[fɒnt] 美[fɑ:nt]

n. Font; font; baptistery (located in a church, often made of stone ); (same font and size) a set of typefaces

Plural: fonts

variant

英[ˈveəriənt] 美[ˈveriənt]

n. (word, etc.) variant, (character sound) transliteration; [生] variant, variant; deformation, variable, transformation; [unified] variant

adj. Variation ; Different, different, inconsistent; diverse; variable, indefinite

Plural: variants

javascript fontVariant property syntax

Function:Set the font of small capital letters to display text

Syntax: Object.style.fontVariant=normal|small-caps

javascript fontVariant property example

<html>
<head>
<script type="text/javascript">
function setSmallCaps()
{
document.getElementById("p1").style.fontVariant="small-caps";
}
</script>
</head>
<body>

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

<input type="button" onclick="setSmallCaps()" 
value="Display small-caps font" />

</body>
</html>

Run instance »

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