英 [fɔnt weit] US [fɑnt wet]

[理][WIN]font grayscale

javascript fontWeight property syntax

Function:Set the thickness of characters.

Syntax: Object.style.fontWeight=value

javascript fontWeight property example

<html>
<head>
<script type="text/javascript">
function setFontWeight()
{
document.getElementById("p1").style.fontWeight="900";
}
</script>
</head>
<body>

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

<input type="button" onclick="setFontWeight()"
value="Display bold text" />

</body>
</html>

Run instance »

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