String.prototype.big() is a deprecated HTML wrapper method (same API as MDN String.prototype.big()). It returns a string that wraps your text in a <big> tag. Learn what it builds, why that element is obsolete, and how to replace it with CSS font-size — with five examples and try-it labs.
01
Kind
Instance method
02
Returns
HTML string
03
Status
Deprecated
04
Params
None
05
Mutates?
No
06
Prefer
CSS font-size
Fundamentals
Introduction
Early JavaScript included helpers that wrapped text in HTML presentation tags — big(), small(), bold(), italics(), and others. They made it easy to inject markup with innerHTML.
Today those wrappers are deprecated. big() still works in browsers for compatibility, but the <big> element itself was removed from HTML. Font size belongs in CSS.
💡
Learn it, don’t ship it
Study big() so you can recognize legacy code. For new pages, style text with font-size (or a utility class) instead of building <big> strings.
Unlike some attribute wrappers, big() does not escape < inside the text. That is another reason to avoid injecting untrusted strings via innerHTML.
📈 Practical Patterns
Legacy injection patterns and the modern CSS replacement.
Example 3 — Injecting with innerHTML (Legacy)
How older demos used the returned string — still produces obsolete markup.
JavaScript
const contentString = "Hello, world";
const html = contentString.big();
// document.body.innerHTML = html; // legacy pattern — avoid in new apps
console.log(html);
// Warning: is not a valid element in modern HTML
You get a real element, valid markup, and a clear size value. Prefer a CSS class in production so styles stay maintainable.
Applications
🚀 Common Use Cases
Reading legacy tutorials — recognize HTML wrapper methods in old samples.
Migrating old scripts — replace big() with CSS font-size.
Teaching string immutability — show that methods return new strings.
Not for new apps — do not use big() to enlarge UI text.
Design systems — use type scale tokens / utility classes instead.
Safer markup — prefer textContent + CSS over innerHTML strings.
🧠 How big() Builds Markup
1
Start with text
You call str.big() on a string receiver.
Input
2
Wrap with tags
Concatenate <big> + text + </big>.
Wrap
3
Return an HTML string
No DOM node is created — only text markup.
Result
4
⚠️
Prefer CSS instead
Set font-size on a real element for valid styling.
Important
📝 Notes
big() is deprecated — standardized only for compatibility.
The <big> element was removed from the HTML specification.
It returns a string, not a DOM node.
It takes no parameters.
Other HTML wrappers (small(), bold(), fontcolor(), …) share the same fate.
Avoid assigning untrusted strings to innerHTML.
Compatibility
Browser & Runtime Support
String.prototype.big() is still widely implemented for compatibility, but it is deprecated. Do not use it in new projects.
✓ Deprecated · Legacy
String.big()
Available in modern browsers for old code, but MDN recommends CSS font-size instead.
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
big()Avoid in new code
Bottom line: Recognize big() in legacy samples. For new UI, control text size with CSS font-size — never rely on the obsolete element from HTML wrapper methods.
Wrap Up
Conclusion
String.prototype.big() builds an obsolete <big>...</big> HTML string. It is useful for understanding history and migrating old code — not for writing new features.
Use CSS font-size (or design tokens) for larger text
Prefer semantic headings when size means hierarchy
Prefer textContent over string-built HTML
Replace big() when you touch legacy files
Learn wrappers only to recognize deprecated APIs
❌ Don’t
Use big() in new production code
Assume <big> is valid modern HTML
Inject untrusted big() output via innerHTML
Expect big() to return a live element
Mix HTML wrappers with modern component frameworks
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about String.big()
Deprecated HTML wrapper — prefer CSS font-size.
5
Core concepts
📝01
Returns
HTML string
API
⚠️02
Status
deprecated
Legacy
❌03
Markup
invalid
HTML
✓04
Replace
font-size
Modern
⚡05
Mutates
no
Immutable
❓ Frequently Asked Questions
String.prototype.big() returns an HTML string that wraps the text in a <big> element — for example "Hello".big() returns '<big>Hello</big>'. It takes no parameters.
Yes. MDN marks all HTML wrapper methods as deprecated. The <big> element itself was removed from the HTML specification. Prefer CSS font-size instead.
The <big> element is obsolete. Modern HTML and accessibility guidelines expect font size to come from CSS, not presentational tags.
No. Strings are immutable. big() returns a new string containing HTML markup. The original text stays the same.
Set CSS font-size on an element, for example element.style.fontSize = "2em", or use a CSS class. Do not build <big> tags with string methods.
It remains widely available for compatibility, but you should not use it in new code. Prefer CSS.
Did you know?
HTML once had both <big> and <small> for relative font size. <small> survived with a semantic meaning (side comments), while <big> was removed — size alone is a CSS concern.