R I S K M O N I T O R

Loading

Intelligent Cybersecurity Check for vulnerabilities now

Accessible Object Elements and Alternative Text

Rule ID: object-alt
Ruleset: axe-core 4.10
User Impact: Serious
Guidelines: WCAG 2.1 (A), WCAG 2.0 (A), WCAG 2.2 (A), Section 508, EN 301 549


How to Fix the Problem

To ensure accessibility, all <object> elements embedded in a web page must have an appropriate and descriptive text alternative. This can be achieved by using one of the following methods:

  1. Using the title attribute:

    html
    <object data="path/to/content" title="Descriptive text about the object"></object>
  2. Using the aria-label attribute:

    html
    <object data="path/to/content" aria-label="Descriptive label text"></object>
  3. Using the aria-labelledby attribute:
    First, define a visible label:

    html
    <span id="label1">Descriptive label for the object</span>

    Then reference it from the object:

    html
    <object data="path/to/content" aria-labelledby="label1"></object>
  4. Using role="presentation" or role="none" if the object is purely decorative and conveys no content or functionality:

    html
    <object data="path/to/content" role="presentation"></object>

Do Not Use:

  • Empty <object> elements.

  • <object> tags with empty child elements like <div> </div>.

  • Objects containing generic fallback content like “This object has no alternative text.”

These will fail accessibility checks and negatively impact screen reader users.


Why it Matters

The <object> element is used to embed external resources like multimedia or web pages. However, these elements are inherently non-text, meaning they cannot be interpreted by screen readers unless a meaningful text alternative is provided.

Without alternative text:

  • Screen readers cannot convey the purpose or content of the embedded object to blind or visually impaired users.

  • Users may hear only a vague description like “object” or hear nothing at all, causing confusion and a barrier to accessing content.

By providing a text alternative, you ensure that:

  • Users understand the purpose or content of the embedded object.

  • The experience for screen reader users is equivalent to that of sighted users.

When crafting alternative text, consider:

  • Why is this object here?

  • What does it represent or do?

  • What text would I use if this object couldn’t be seen?

Avoid including unhelpful words like “image,” “object,” or file names, which do not add value to the description.


Rule Description

Every embedded <object> must include a descriptive and meaningful text alternative, allowing screen readers to interpret and convey its purpose or content to users.


The Algorithm (in simple terms)

The rule checks every <object> tag in the HTML. If it doesn’t find:

  • a title attribute,

  • an aria-label attribute,

  • an aria-labelledby reference,

  • or a role of presentation or none,

then it flags the element as failing the accessibility check.

Leave A Comment