--- title: String.prototype.big() slug: Web/JavaScript/Reference/Global_Objects/String/big tags: - Deprecated - HTML wrapper methods - JavaScript - Method - Prototype - Reference - String - Polyfill browser-compat: javascript.builtins.String.big translation_of: Web/JavaScript/Reference/Global_Objects/String/big ---
big() メソッドは、文字列が大きなフォントで表示されるように HTML の {{HTMLElement("big")}} 要素を生成します。
big()
HTML の {{HTMLElement("big")}} 要素を含む文字列です。
big() メソッドは、文字列を <big> 要素の中に、 "<big>str</big>" のように埋め込みます。
以下の例では文字列のメソッドを使用して、文字列の大きさを変更しています。
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)); // <fontsize=7>Hello, world</fontsize>
{{domxref("HTMLElement/style", "element.style")}} オブジェクトを使用すると、要素の style 属性を使用して、次のようにもっと汎用的に操作することができます。
document.getElementById('yourElemId').style.fontSize = '2em';
{{Compat}}
String.prototype.big のポリフィルは core-js から利用できます