--- title: String.prototype.small() slug: Web/JavaScript/Reference/Global_Objects/String/small tags: - Deprecated - HTML wrapper methods - JavaScript - Method - Prototype - Reference - String translation_of: Web/JavaScript/Reference/Global_Objects/String/small --- <div>{{JSRef}} {{deprecated_header}}</div> <p><strong><code>small()</code></strong> メソッドは、文字列が小さなフォントで表示されるように HTML の {{HTMLElement("small")}} 要素を生成します。</p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="syntaxbox notranslate"><var>str</var>.small()</pre> <h3 id="Return_value" name="Return_value">返値</h3> <p>HTML の {{HTMLElement("small")}} 要素を含む文字列です。</p> <h2 id="Description" name="Description">解説</h2> <p><code>small()</code> メソッドは、文字列を <code><small></code> 要素の中に、 "<code><small>str</small></code>" のように埋め込みます。</p> <h2 id="Examples" name="Examples">例</h2> <h3 id="small_の使用">small() の使用</h3> <p>以下の例では文字列のメソッドを使用して、文字列の大きさを変更しています。</p> <pre class="brush: js notranslate">var worldString = 'Hello, world'; console.log(worldString.small()); // <small>Hello, world</small> console.log(worldString.big()); // <big>Hello, world</big> console.log(worldString.fontsize(7)); // <font size="7">Hello, world</fontsize> </pre> <p>{{domxref("ElementCSSInlineStyle/style", "element.style")}} オブジェクトを使用すると、要素の <code>style</code> 属性を使用して、次のようにもっと汎用的に操作することができます。</p> <pre class="brush: js notranslate">document.getElementById('yourElemId').style.fontSize = '0.7em'; </pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('ESDraft', '#sec-string.prototype.small', 'String.prototype.small')}}</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> <p>{{Compat("javascript.builtins.String.small")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{jsxref("String.prototype.fontsize()")}}</li> <li>{{jsxref("String.prototype.big()")}}</li> </ul>