サイト内検索

String メソッド(HTML関連)

スポンサー

ホーム > String > bold

bold

HTMLの <b> タグで囲まれた文字列を返します.

シンタックス

stringObject.bold()

サンプルコード

以下にboldメソッドを使用して <b> タグを作成するサンプルコードを示します.

<html>
  <head>
    <title>boldメソッドのサンプルコード</title>
  </head>
  <body>
    <script type="text/javascript" language="javascript">
      var str = "Snoopy";
      document.write("<p>normal: " + str + "</p>");
      document.write("<p>bold: " + str.bold() + "</p>");
    </script>
  </body>
</html>

実行例

サンプルコードの実行結果は以下のようになります.

スポンサード リンク

inserted by FC2 system