String.prototype.small() is a legacy HTML wrapper that returns a new string wrapping your text in <small>…</small>. It takes no parameters. The <small> element is still valid HTML for fine print — the string method is what you should avoid.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call string.small. Start with this line.
JavaScript
string.small()
Call
What it does
string.small()
Primary signature.
string.small(...)
Call with the arguments your case needs.
Built into JavaScript. Call small(...) on a string (or String instance) — no import required.
Library declarations
JavaScript
string.small()
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
HTML string with <small> tags
JavaScript Examples
Example 1 — Basic Wrap
Call small() to build the classic <small> HTML string.
JavaScript
const text = "Fine print";
console.log(text.small());
// "<small>Fine print</small>"
Empty input."".small() still wraps tags around nothing → "<small></small>".
No escaping."A < B" keeps the < character inside the markup.
Type is string. You get text, not a live DOM element.
Safety tip. Never feed untrusted input through small() into innerHTML.
Example 3 — Prefer DOM
Compare the legacy wrapper with a modern createElement approach.
JavaScript
// Legacy — do not use in new code
console.log("Terms apply".small());
// "<small>Terms apply</small>"
// Prefer DOM
const el = document.createElement("small");
el.textContent = "Terms apply";
console.log(el.outerHTML);
// "<small>Terms apply</small>"
Legacy path."Terms apply".small() builds a <small> HTML string.
Create a real element.createElement("small") makes a live node.
Set plain text.textContent is safer than injecting markup strings.
Rule of thumb. Learn small() to read old code; ship DOM or CSS for new UI.
Compatibility
Browser & Runtime Support
String.prototype.small() is still implemented widely for compatibility, but it is deprecated. Do not use it in new projects.
✓ Deprecated · Legacy
String.prototype.small()
Available in major browsers and Node.js for legacy compatibility. Prefer DOM APIs or CSS font-size for new code.
LegacyCompatibility only
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
small()Avoid in new code
Bottom line: Recognize small() when reading old code. For new UI, create a <small> element with textContent or use CSS font-size — never build markup with string wrappers.
Frequently Asked Questions
String.prototype.small() returns an HTML string that wraps the text in a <small> element — for example "Hello".small() returns "<small>Hello</small>". It takes no parameters.
Yes. MDN marks all HTML wrapper methods as deprecated. Prefer document.createElement("small") or CSS font-size instead of building markup with string methods.
Yes. Unlike <big>, the <small> element remains in HTML for side comments and fine print. What is deprecated is the String.small() helper that builds that markup as a string.
No. Strings are immutable. small() returns a new string containing HTML markup. The original text stays the same.
Use document.createElement("small") and set textContent, or style an element with CSS font-size. Avoid injecting string-built HTML via innerHTML when you can create real nodes.
No. Characters like < and > are left as-is inside the wrapper. Never pass untrusted user input through small() into innerHTML.