Document.applets is a read-only deprecated instance property that once listed Java <applet> elements on a page. Today it always returns an empty HTMLCollection. Learn why applets disappeared, what legacy code looked like, and how to clean up obsolete detection scripts—with five examples and try-it labs.
01
Kind
Read-only property
02
Returns
HTMLCollection
03
Status
Deprecated
04
Length
Always 0 today
05
Element
<applet> removed
06
Today
Compatibility only
Fundamentals
Introduction
In the late 1990s and early 2000s, some websites embedded Java programs using the HTML <applet> tag. Scripts could enumerate them with document.applets, similar to how document.anchors listed named anchors.
That era is over. MDN notes that support for the <applet> element has been removed by all browsers, so document.applets always returns an empty collection now.
💡
Learn it for history, not for shipping
Study document.applets to understand legacy intranet pages and old tutorials—then remove or rewrite any applet-related code you still find. See MDN Document: applets.
A read-only instance property on Document. Its value is an HTMLCollection. In historical browsers it listed every <applet> element; in modern engines the collection is always empty.
Value — HTMLCollection (empty in all current browsers).
Read-only — you do not assign a new collection to document.applets.
Legacy purpose — enumerate embedded Java applets on a page.
Modern reality — length is 0; no applets run.
Indexed access — document.applets[i] is always undefined today.
Document.applets is deprecated and returns an empty collection in all modern browsers because the <applet> element is no longer supported. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Deprecated · Removed feature
Document.applets
Legacy HTMLCollection for Java applets — always empty today; applet element removed.
RemovedCompatibility shell only
Google ChromeApplet removed · empty collection
Deprecated
Mozilla FirefoxApplet removed · empty collection
Deprecated
Apple SafariApplet removed · empty collection
Deprecated
Microsoft EdgeApplet removed · empty collection
Deprecated
OperaFollow Chromium behavior
Deprecated
Internet ExplorerHistorical applet support (EOL)
Legacy only
Document.appletsAlways empty
Bottom line: document.applets exists so old scripts do not crash. Do not embed applets or depend on this property — use modern web APIs for interactive content.
Wrap Up
Conclusion
Document.applets is a deprecated read-only property from the Java-applet era. Modern browsers keep it as an empty HTMLCollection so legacy scripts do not break. Learn it to read old code and remove obsolete applet logic—not to build new features.
Delete dead document.applets.length checks during refactors
Use Canvas, WebGL, or WebAssembly for interactive content
Document legacy behavior when auditing old enterprise sites
Prefer open web standards over browser plugins
❌ Don’t
Embed Java applets in new projects
Expect document.applets to list anything today
Keep plugin-detection code that can never succeed
Confuse applets with <embed> or <object> without reviewing specs
Assume a future browser will restore applet support
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about document.applets
Deprecated empty collection — Java applets are gone.
5
Core concepts
📄01
Returns
HTMLCollection
API
⚠️02
Status
deprecated
Legacy
🔢03
Length
always 0
MDN
☕04
Element
<applet>
Removed
🛠05
Action
remove legacy code
Migrate
❓ Frequently Asked Questions
A read-only HTMLCollection that is always empty in modern browsers. It exists only for backwards compatibility with very old pages that embedded Java applets.
Yes. MDN marks Document.applets as deprecated. Support for the HTML applet element has been removed from all major browsers, so the property no longer lists any elements.
Browsers no longer support the obsolete <applet> element. MDN states that calling document.applets always returns an empty collection today.
Applets were small Java programs embedded in web pages via <applet>. They required a browser plugin and were replaced by modern web APIs such as Canvas, WebGL, and WebAssembly.
No direct replacement exists because applets themselves are obsolete. Build interactive content with standard web technologies instead of querying for applet elements.
No. Do not embed applets or read document.applets in new code. Remove legacy applet-detection scripts when you maintain old pages.
Did you know?
Java applets once powered everything from online calculators to enterprise dashboards. When browsers dropped NPAPI and plugin support, the DOM kept document.applets as an empty shell so scripts written in 2003 would not throw a ReferenceError on property access.