HTML standby Attribute

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
Legacy & Embedding

Introduction

The standby attribute is used with the <object> element. It was originally meant to display a short text message while embedded content (such as a plugin, document, or media file) is loading. Although it is obsolete and not reliably supported in modern browsers, understanding it helps when reading legacy HTML or maintaining older sites.

For new projects, use JavaScript, CSS, and accessible loading indicators instead of relying on standby.

What You’ll Learn

01

<object>

Only element.

02

Text message

While loading.

03

Obsolete

Legacy attr.

04

JavaScript

Modern pattern.

05

ARIA

Accessible UI.

06

Fallback

Object body.

Purpose of standby

The standby attribute was designed to improve perceived performance by showing a message such as “Loading, please wait…” while an embedded <object> fetched its resource. In the era of Flash and other plugins, this gave users feedback that content was on the way.

Today, native HTML elements like <video>, <iframe>, and <img> cover most embedding needs, and loading states are handled with standard UI patterns rather than the standby attribute.

💡
Obsolete in modern HTML

The WHATWG HTML specification lists standby as obsolete. Browsers may ignore it. Do not use it in new code—prefer JavaScript loading messages with role="status" and aria-live="polite".

📝 Syntax

Set standby to a plain-text message on <object>:

standby.html
<object
  data="document.pdf"
  type="application/pdf"
  standby="Loading, please wait...">
  <p>Your browser does not support embedded objects.</p>
</object>

Syntax Rules

  • Valid only on <object>.
  • Value is a string (the loading message text).
  • Works alongside data and type on the same element.
  • Fallback content inside <object> shows if embedding fails—separate from standby.
  • Obsolete: do not depend on browsers displaying the message.
  • IDL property: HTMLObjectElement.standby.

💎 Values

The standby attribute accepts a string value—the text message to display while the object loads:

  • standby="Loading, please wait..." — Generic loading hint.
  • standby="Video is loading..." — Context-specific message.
  • standby="Fetching document..." — PDF or file embed.
standby-values.html
<object data="chart.svg" type="image/svg+xml" standby="Loading chart...">
  <p>Chart unavailable.</p>
</object>

How It Works

In theory, the browser would show the standby string in the object’s area until the resource in data finished loading. In practice, modern browsers typically skip this step and either show nothing extra or jump straight to the loaded content or fallback markup.

⚡ Quick Reference

TopicDetailExample
Element<object> onlyEmbedded resource
ValuePlain text string"Loading..."
StatusObsoleteNot reliable today
Modern fixJS + ARIA loading UIrole="status"
JavaScriptobject.standbyReflects attribute
FallbackInner HTMLWhen embed fails

Applicable Elements

ElementSupported?Notes
<object>Yes (defined)Only element with standby
<iframe>NoUse loading UI outside frame
<img>, <video>NoDifferent loading models
<embed>NoVoid element, no standby

standby vs JavaScript loading UI

ApproachProsCons
standbySimple HTML attributeObsolete, ignored by browsers
JS + CSS messageFull control, styled UIRequires script
aria-liveScreen reader friendlyNeeds markup pattern
Native lazy loadingloading="lazy" on img/iframeNot for object standby text

Examples Gallery

Legacy standby on object, a modern JavaScript loading pattern, and dynamic object.standby.

👀 Live Preview

An <object> with standby (browsers may not show the message):

Fallback if object fails.

Modern browsers usually render the object directly without displaying the standby text.

Example — object with standby

Basic syntax with a loading message string:

standby.html
<object data="example.svg" type="image/svg+xml" standby="Loading, please wait...">
  <p>Your browser does not support embedded objects.</p>
</object>
Try It Yourself

Implementation Example

Full HTML document embedding media with standby (legacy pattern):

index.html
<object data="example-video.mp4" type="video/mp4" standby="Video is loading...">
  <p>Your browser does not support embedded videos.</p>
</object>

For video today, use <video controls> instead of <object>. The example above shows historical syntax only.

How It Works

The standby string was meant to appear in the object box during fetch. Because support is gone, prefer <video> with native controls or a JavaScript loader.

Dynamic Values with JavaScript

A modern loading message pattern (recommended replacement):

dynamic-standby.html
<div id="loadingMessage" role="status" aria-live="polite">Loading content...</div>
<object id="dynamicObject" data="" type="image/svg+xml"></object>

<script>
  var msg = document.getElementById("loadingMessage");
  var obj = document.getElementById("dynamicObject");
  msg.hidden = false;
  obj.data = "chart.svg";
  obj.addEventListener("load", function () { msg.hidden = true; });
</script>

How It Works

In this script, a loading message is shown when content starts loading and hidden after the load event. This achieves what standby was meant to do, with full browser support and accessibility.

♿ Accessibility

  • Do not rely on standby — Screen readers generally do not announce obsolete standby text.
  • Use live regions — Put loading text in an element with role="status" and aria-live="polite".
  • Provide fallback content — Meaningful text inside <object> when embedding fails.
  • Avoid flicker — Hide loading UI quickly once content is ready.
  • Focus management — Do not trap keyboard focus in loading overlays.

🧠 How standby Works

1

Author sets message

standby string.

Markup
2

Browser fetches data

object resource.

Network
3

Message then embed

Intended UX flow.

Legacy
=

Use JS instead

Modern loading UI.

Browser Support

The standby attribute is obsolete and effectively unsupported in modern browsers. Treat it as historical documentation only.

Obsolete · Not reliable

Legacy attribute

Modern browsers ignore standby. Use JavaScript loading patterns for new work.

<5% Effective support
Google Chrome Ignored
Obsolete
Mozilla Firefox Ignored
Obsolete
Apple Safari Ignored
Obsolete
Microsoft Edge Ignored
Obsolete
standby attribute Obsolete

Bottom line: Learn it for legacy code; use JavaScript + ARIA for loading messages in new projects.

💡 Best Practices

✅ Do

  • Use JavaScript and CSS for loading messages in new sites
  • Add role="status" and aria-live="polite" for accessibility
  • Prefer <video>, <iframe>, or <img> over object when possible
  • Keep fallback content inside <object>
  • Document legacy standby usage when maintaining old codebases

❌ Don’t

  • Depend on standby in production UX
  • Embed Flash or obsolete plugins (old examples)
  • Assume object.onload fires for all resource types
  • Skip accessible loading feedback
  • Use object for video when video suffices

Conclusion

The standby attribute was designed to show a message while <object> content loads. While not commonly used today, understanding it helps when reading legacy HTML and appreciating how loading UX has evolved.

In modern web development, achieve the same goal with JavaScript, CSS, and accessible live regions. That gives you better compatibility, styling control, and support across all browsers.

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about standby

Bookmark these when you encounter legacy embeds.

5
Core concepts
📦 02

object only

One element

Scope
03

Obsolete

Not reliable

Status
⚙️ 04

JS loader

Modern fix

Replace
05

aria-live

Accessible

A11y

❓ Frequently Asked Questions

It was meant to show a text message while an object element’s resource loads.
Only the <object> element.
No. It is obsolete and ignored by modern browsers. Use JavaScript loading UI instead.
A visible loading element controlled with JavaScript, hidden on load, with role="status" for screen readers.
Yes via object.standby, but it rarely affects what users see. Prefer a separate loading element.
To maintain and understand legacy HTML embeds and see how loading UX evolved in web standards.

Handle loading states the modern way

Practice the JavaScript loading pattern that replaces obsolete standby.

Try modern loading pattern →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful