Skip to main content
HTML Validation

The “name” attribute on the “embed” element is obsolete. Use the “id” attribute instead.

About This HTML Issue

Replace name on an <embed> element with id, or delete it if nothing refers to it.

The name attribute on <embed> dates from the plugin era, when pages named a Flash movie or other plugin content so a script could find it. The HTML standard lists it among the obsolete attributes and points to id as the way to identify the element. The validator reports this warning together with a second message saying that name is never allowed on <embed>. Both point at the same attribute, and the same change fixes both.

Before you rename it, search your scripts and stylesheets for the old name. Code that looked the element up by name should call document.getElementById() with the new id, and an id must be unique in the document. If no code uses the name, remove the attribute and leave the id out.

Invalid example

<embed src="sales-chart.svg" type="image/svg+xml" name="sales" width="600" height="400">

Valid example

<embed src="sales-chart.svg" type="image/svg+xml" id="sales" width="600" height="400">
<script>
  const chart = document.getElementById("sales");
</script>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries