Document.applets is a read-only property that returns an HTMLCollection. In older browsers it listed Java <applet> elements; today it is always empty (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use document.applets. Start with this line.
JavaScript
document.applets
Call
What it does
document.applets
Primary signature.
Built into the browser. Read or assign document.applets — no import required.
Library declarations
JavaScript
document.applets
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
Empty HTMLCollection
JavaScript Examples
Example 1 — length Is Always Zero
Confirm the collection is empty on today’s browsers.
Branch on length. Old sites used this to detect embedded Java.
Else path always wins today. Modern browsers hit the empty case.
Migration tip. Delete the branch that assumes applets can run.
Replace the feature. Rebuild the interaction with current web APIs.
Compatibility
Browser Support
Document.applets is Deprecated (MDN). Engines may still expose the property, but it returns an emptyHTMLCollection because <applet> support was removed.
✓ Deprecated · Always empty
Document.applets
Legacy empty HTMLCollection — kept only for compatibility with old scripts.
LegacyAvoid in new apps
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
appletsDeprecated
Bottom line: Safe to read without throwing, but useless for features. Remove applet detection and rebuild interactive content with modern web APIs.
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.
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 needed a browser plugin and were replaced by modern web technologies such as Canvas, WebGL, and WebAssembly.
No direct replacement — applets themselves are obsolete. Build interactive content with standard web APIs 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.