Document.plugins is a read-only instance property that returns a live HTMLCollection of every <embed> element in the document. Learn how it matches document.embeds, how it differs from navigator.plugins, and five examples with try-it labs.
01
Kind
Read-only property
02
Returns
HTMLCollection
03
Matches
<embed> only
04
Same as
document.embeds
05
Not
navigator.plugins
06
Status
Baseline widely
Fundamentals
Introduction
The name plugins can be confusing. On Document, it does not list Flash or PDF browser plugins installed on the machine. It lists the <embed> elements currently in the HTML page.
MDN: the plugins read-only property returns an HTMLCollection containing one or more HTMLEmbedElement objects representing the <embed> elements in the current document. For a list of installed plugins, MDN says to use Navigator.plugins instead.
💡
Same list as document.embeds
In modern HTML, document.plugins and document.embeds return the same live collection. Pick either name; many newer tutorials prefer embeds because it matches the tag.
A read-only instance property on Document. Its value is a live HTMLCollection of every <embed> in the document tree.
Value — HTMLCollection of HTMLEmbedElement objects (MDN).
Read-only — you do not assign a new collection to document.plugins.
Live collection — reflects DOM changes when embeds are added or removed.
Indexed access — document.plugins[i] or item(i).
Alias — same collection as document.embeds in modern HTML.
Not Navigator — installed plugins live on navigator.plugins (MDN).
Foundation
📝 Syntax
JavaScript
document.plugins
Value
An HTMLCollection of <embed> elements in the document (MDN).
Common patterns
JavaScript
const count = document.plugins.length;
const first = document.plugins[0];
for (const el of document.plugins) {
console.log(el.src);
}
// Same collection as embeds:
console.log(document.plugins === document.embeds); // true in modern browsers
CSS-selector alternative
JavaScript
const embeds = document.querySelectorAll("embed");
// Static NodeList — does not auto-update when you add/remove embeds
Compare
⚖️ document.plugins vs Related APIs
API
Returns
Notes
document.plugins
Live HTMLCollection of embed
This page (MDN)
document.embeds
Same collection as plugins
Clearer name for many beginners
navigator.plugins
Installed browser plugins
Different API (MDN note)
document.querySelectorAll("embed")
Static NodeList
Flexible CSS filters
document.images
Live list of img
Similar collection pattern
Cheat Sheet
⚡ Quick Reference
Goal
Code / note
All embeds
document.plugins
Count
document.plugins.length
First embed
document.plugins[0]
Read source
document.plugins[0].src
Same collection
document.embeds
Installed plugins
navigator.plugins (not Document)
MDN status
Baseline Widely available (since Jun 2018)
Snapshot
🔍 At a Glance
Four facts about document.plugins.
Type
HTMLCollection
Read-only, live
Contains
embed
HTMLEmbedElement
Alias
embeds
Same list
Status
baseline
Widely available
Compare
📋 document.plugins vs navigator.plugins
document.plugins
navigator.plugins
Interface
Document
Navigator
Lists
<embed> elements in the page
Installed browser plugins
Item type
HTMLEmbedElement
Plugin descriptors (legacy)
MDN tip
Page embeds
Use this for installed plugins
Hands-On
Examples Gallery
Examples follow MDN Document: plugins. Use View Output or Try It Yourself for each case.
📚 Getting Started
Count embeds and read each resource URL.
Example 1 — Check document.plugins.length
Count how many <embed> elements exist on the page.
JavaScript
const count = document.plugins.length;
console.log("embed count:", count);
if (count === 0) {
console.log("No <embed> elements on this page");
}
Document.plugins is marked Baseline Widely available on MDN (since June 2018). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Widely available
Document.plugins
Read-only live HTMLCollection of every embed element — same list as document.embeds.
UniversalWidely available
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerSupported in legacy IE
Full support
Document.pluginsExcellent
Bottom line: Use document.plugins (or document.embeds) to list every embed on a page. Do not confuse it with navigator.plugins for installed browser plugins.
Wrap Up
Conclusion
Document.plugins is the live list of every <embed> in a document—the same collection as document.embeds. Use it to count and inspect embeds, and remember that installed browser plugins belong to navigator.plugins instead.
Treat document.plugins as a list of <embed> elements
Prefer document.embeds in new code for clearer naming
Use navigator.plugins when you need installed plugins (MDN)
Remember the collection is live after DOM changes
Use querySelectorAll("embed") for static snapshots or filters
❌ Don’t
Expect Flash/PDF installer lists from document.plugins
Assume iframe / object / video appear in the collection
Confuse Document and Navigator plugin APIs
Rely on plugin-based embeds for modern media when video/iframe fit better
Cache length across long loops if DOM may change mid-loop
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about document.plugins
Embed elements on the page — not installed browser plugins.
5
Core concepts
🔌01
Returns
HTMLCollection
API
📄02
Items
HTMLEmbedElement
<embed>
🔄03
Alias
document.embeds
Same
⚠️04
Not
navigator.plugins
MDN
🔍05
Live
Auto-updates
DOM
❓ Frequently Asked Questions
A read-only HTMLCollection of every <embed> element in the current document (HTMLEmbedElement objects). MDN: one or more HTMLEmbedElement objects representing the embed elements in the document.
No. MDN marks Document.plugins as Baseline Widely available (since June 2018). It is a standard Document collection property.
Yes in modern HTML. Both return the same live HTMLCollection of embed elements on the page.
No. document.plugins lists <embed> elements in the document. navigator.plugins lists installed browser plugins (a different API). MDN tells you to use Navigator.plugins for installed plugins.
Yes. HTMLCollection is live — if you add or remove an <embed>, document.plugins.length and indexed access update automatically.
Either works for the same list. Many tutorials prefer document.embeds because the name matches the HTML tag. Use document.plugins when reading older code that already uses that name.
Did you know?
The word “plugins” stuck from the era when <embed> often loaded NPAPI plugins. Today the property still means “every embed on this page,” even though classic browser plugins are largely gone. That historical name is why MDN warns beginners to use navigator.plugins for installed plugins instead.