fontFamily

文字の書体/フォントを参照/設定します。設定できる値はCSSと同じです。

構文

オブジェクト.style.fontFamily

例文

<html>
 <head>
  <title>fontFamily</title>
  <script type="text/javascript"><!--
  function changeCSS() {
   document.getElementById("result").style.fontFamily = "Palatino";
  }
  // --></script>
 </head>
 <body>
 <div id="result" style="border:1px solid black">Sample text</div>
 <form>
  <input type="button" value="Change" onClick="changeCSS()">
 </form>
 </body>
</html>

関連記事

スポンサーリンク

DATEADD関数 日付を加算する

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る