[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/fontsize [Back]  [Original]

String.prototype.fontsize() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

String.prototype.fontsize()

Deprecated

Avoid using this feature in new projects. HTML wrapper methods exist only for backwards compatibility. Use DOM APIs to create elements instead. This feature may be a candidate for removal from web standards or browsers.

Consider using the following features instead: DOM.

fontsize() String <font> (<font size="...">str</font>)

: HTML fontsize() <font> HTML CSS

js
fontsize(size)

size

1 7 1 7

<font size="size"> size &quot; str </font>

fontsize() <font> str 7 size "-2" "+3" str

fontsize()

HTML

js
const contentString = "Hello, world";

document.body.innerHTML = contentString.fontsize(7);

HTML

html
<font size="7">Hello, world</font>

: font

fontsize( ) HTML CSS element.style font-size

js
document.getElementById("yourElemId").style.fontSize = "7pt";

ECMAScript 2027 LanguageSpecification
# sec-string.prototype.fontsize


Web Proxy Viewer  |  New URL  |  Original Page