英 [f?nt weit] 美 [fɑnt wet]

[calcul][WIN] police en niveaux de gris

propriété javascript fontWeight syntaxe

Fonction?: Définissez l'épaisseur des caractères.

Syntaxe?: Object.style.fontWeight=value

propriété javascript fontWeight exemple

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

Exécuter l'instance ?

Cliquez sur le bouton ??Exécuter l'instance?? pour afficher l'instance en ligne