JavaScript Document plugins Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

document.plugins is a read-only property that returns a live HTMLCollection of every <embed> element in the document (MDN). In modern HTML it is the same collection as document.embeds.

Read the notes below before you get or set this property. Prefer feature detection when support is limited.

Syntax

Use document.plugins. Start with this line.

JavaScript
document.plugins
CallWhat it does
document.pluginsPrimary signature.

Built into the browser. Read or assign document.plugins — no import required.

Library declarations
JavaScript
document.plugins

Parameters

ParameterDescription
Writable?Optional. Read-only

Return Value

Return ValueDescription
*Live HTMLCollection

JavaScript Examples

Example 1 — Count with plugins.length

Count every <embed> 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");
}
Try It Yourself

How It Works

  1. Read document.plugins. Live collection of embeds (MDN).
  2. Use .length. Counts <embed> tags — not installed plugins.
  3. Iframes / objects do not count. Query those separately.
  4. Guard empty pages before indexing [0].

Example 2 — Same Object as document.embeds

Modern browsers expose one shared collection under two names.

JavaScript
console.log(document.plugins === document.embeds);
console.log(document.plugins.length === document.embeds.length);
Try It Yourself

How It Works

  1. Compare with ===. Same object reference in modern HTML.
  2. Compare lengths. Confirms both lists match.
  3. Either name works. Prefer embeds in new tutorials for clarity.
  4. Keep plugins when reading older scripts that already use it.

Example 3 — Not navigator.plugins

MDN: use Navigator.plugins for installed plugins — not Document.

JavaScript
console.log("document.plugins length:", document.plugins.length);
console.log("navigator.plugins length:", navigator.plugins.length);
console.log("Same object?", document.plugins === navigator.plugins);
// false — totally different APIs
Try It Yourself

How It Works

  1. Log Document length. Number of <embed> tags.
  2. Log Navigator length. Installed-plugin list (different API).
  3. Compare with ===. Always false — different objects.
  4. Remember the rule: Document = page embeds; Navigator = installed plugins (MDN).

Browser Support

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.

Widely Available
Google Chrome Full support · Desktop & Mobile
Full support
Mozilla Firefox Full support · Desktop & Mobile
Full support
Apple Safari Full support · macOS & iOS
Full support
Microsoft Edge Full support · Chromium
Full support
Opera Full support · Modern versions
Full support
Internet Explorer Supported in legacy IE
Full support
Document.plugins Baseline support

Bottom line: Use document.plugins (or document.embeds) to list every embed on a page. Do not confuse it with navigator.plugins. See the MDN Document.plugins reference.

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. MDN: 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.

Next: Document pointerLockElement

Learn which element currently owns pointer lock.

pointerLockElement tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful