Skip to main content
HTML Validation

The “name” attribute is never allowed on the “embed” element.

About This HTML Issue

The <embed> element has no name attribute in HTML5, so identify it with id instead.

Old plugin markup, especially Flash movies wrapped in <object> and <embed>, often gave the embed a name so scripts could reach it through document.embeds["movie"] or document["movie"]. The HTML standard lists name on <embed> as obsolete. The validator reports this message together with a second one that calls the attribute obsolete and suggests id. Removing name clears both.

An id does the same job. document.getElementById("movie") returns the element, and document.embeds["movie"] also finds it by its id. A script that used the document["movie"] shortcut needs to switch to getElementById, because that shortcut does not pick up an <embed> by id. If no script or CSS refers to the name, you can delete the attribute without adding an id.

Invalid example

<embed src="intro.mp4" type="video/mp4" name="intro" width="640" height="360">

Valid example

<embed src="intro.mp4" type="video/mp4" id="intro" width="640" height="360">

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