String.prototype.blink() is a deprecated HTML wrapper method (same API as MDN String.prototype.blink()). It returns a string that wraps your text in a <blink> tag. Learn what it builds, why blinking text was removed, why accessibility standards discourage it, and what to do instead — 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
No blink / a11y
Fundamentals
Introduction
Early JavaScript included helpers that wrapped text in HTML presentation tags — blink(), big(), bold(), italics(), and others. They made it easy to inject markup with innerHTML.
Today those wrappers are deprecated. blink() may still return a string for compatibility, but the <blink> element was removed from modern browsers. Blinking text is discouraged for accessibility, and the element is gone.
💡
Learn it, don’t ship it
Study blink() so you can recognize legacy code. For new pages, emphasize text without blinking (color, weight, size) instead of building <blink> strings.
Calling str.blink() does not create a live DOM node and does not take arguments. It concatenates an HTML string: <blink> + text + </blink>.
It is an instance method on strings (auto-boxed if needed).
It returns a new string — the original is unchanged.
No parameters — just str.blink().
Prefer non-blinking emphasis for real UI.
Foundation
📝 Syntax
General form of String.prototype.blink:
JavaScript
str.blink()
Parameters
None.
Return value
A string beginning with a <blink> start tag, then the text of str, then a </blink> end tag.
Common patterns
JavaScript
"Hello, world".blink();
// ''
// Prefer static emphasis — do not blink text
const el = document.getElementById("yourElemId");
el.style.fontWeight = "700";
Cheat Sheet
⚡ Quick Reference
Goal
Code
Legacy HTML string
str.blink()
Result shape
<blink>...</blink>
Modern emphasis
el.style.fontWeight = "700"
Use in new apps?
No — deprecated
Snapshot
🔍 At a Glance
Four facts to remember about String.blink().
Returns
string
HTML markup text
Status
deprecated
Compatibility only
Tag
<blink>
Removed from browsers
Replace with
no blink
Accessibility first
Compare
📋 blink() vs static emphasis
str.blink()
Static CSS emphasis
Result
HTML string
Styled live element (no flash)
Valid HTML today?
No (<blink> removed)
Yes
Recommended?
No
Yes
Best for
Reading legacy code
New UI / apps
Hands-On
Examples Gallery
Examples follow MDN String.blink() patterns. Use View Output or Try It Yourself for each case.
Other HTML wrappers (big(), bold(), fontcolor(), …) share the same fate.
Avoid assigning untrusted strings to innerHTML.
Compatibility
Browser & Runtime Support
String.prototype.blink() is still widely implemented for compatibility, but it is deprecated. Do not use it in new projects.
✓ Deprecated · Legacy
String.blink()
Available in modern browsers for old code, but MDN advises avoiding blinking elements altogether.
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
blink()Avoid in new code
Bottom line: Recognize blink() in legacy samples. For new UI, emphasize text without blinking — never rely on the obsolete
Wrap Up
Conclusion
String.prototype.blink() builds an obsolete <blink>...</blink> HTML string. It is useful for understanding history and migrating old code — not for writing new features.
Use static CSS emphasis (weight, color, size) when you need attention
Prefer calm visual hierarchy over flashing text
Prefer textContent over string-built HTML
Replace blink() when you touch legacy files
Honor prefers-reduced-motion if you ever animate
❌ Don’t
Use blink() in new production code
Assume <blink> still blinks in modern browsers
Inject untrusted blink() output via innerHTML
Expect blink() to return a live element
Mix HTML wrappers with modern component frameworks
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about String.blink()
Deprecated HTML wrapper — do not blink text.
5
Core concepts
📝01
Returns
HTML string
API
⚠️02
Status
deprecated
Legacy
❌03
Markup
invalid
HTML
✓04
Replace
no blink
Modern
⚡05
Mutates
no
Immutable
❓ Frequently Asked Questions
String.prototype.blink() returns an HTML string that wraps the text in a <blink> element — for example "Hello".blink() returns '<blink>Hello</blink>'. It takes no parameters.
Yes. MDN marks all HTML wrapper methods as deprecated. The <blink> element was removed from modern browsers. Avoid blinking text for accessibility reasons.
The <blink> element is obsolete and no longer rendered by modern browsers. Accessibility standards also discourage blinking content because it can distract users and trigger seizures in sensitive people.
No. Strings are immutable. blink() returns a new string containing HTML markup. The original text stays the same.
Do not blink text. Prefer static emphasis with color, weight, or size. If motion is essential, use a careful CSS animation and respect prefers-reduced-motion.
The method may still return a string for compatibility, but the <blink> element itself does not blink in modern browsers. Do not use it in new code.
Did you know?
Browsers dropped <blink> because flashing text harmed usability and accessibility — emphasis belongs in careful design, not compulsory blinking. WCAG also advises against content that flashes more than a few times per second.