<object> elements have alternate text

Embedded objects have alt text so screen readers can describe their content.

On this page

Impact

ScanGov impact ratings

About

Screen readers cannot translate non-text content. Adding alternate text to <object> elements helps screen readers convey meaning to users.

Risks

Screen reader users cannot identify or interact with elements.

Why it's important

Gives screen reader users meaningful descriptions of interactive elements so they can understand and use them.

User stories

As a screen reader user, I want all interactive elements to have clear, descriptive names so that I know what they do.

Code

Failing pattern:

<!-- Fail: no accessible name or fallback content -->
<object data="report.pdf" type="application/pdf"></object>

Passing pattern:

<!-- Pass: aria-label + fallback link -->
<object data="report.pdf" type="application/pdf" aria-label="2024 Annual Report (PDF)">
  <p><a href="report.pdf">Download the 2024 Annual Report (PDF)</a></p>
</object>

Error

ScanGov messaging when a site fails a standard:

Failed: <object> elements have alternate text

Guidance

Indicators

On this page