The <applet> element once embedded a Java applet — a compiled Java program (.class / JAR) that ran inside the page through the Java browser plugin.
You pointed at the class with code, sized the box with width / height, and passed settings with <param>. Today, study it for legacy pages only — never ship it in new HTML.
Obsolete.
Removed from HTML5 / the Living Standard for authors. Modern browsers do not run Java applets; they show nested fallback text at most.
Use instead.
Prefer <script> + DOM/CSS, <canvas> / WebGL for drawing, or WebAssembly for heavy compute. For generic embeds, see <object> and <embed> (still not for Java applets).
Both start and end tags were required. Nested text (and <param> children) acted as fallback when the applet could not run — which is what every current browser effectively does.
Reference
Attributes
Historical attributes on <applet> (all obsolete with the element):
Draw with <canvas>. No plugin — the browser paints pixels via JavaScript.
Get a 2D context with getContext("2d").
Update on a timer (here, once per second) instead of a Java applet loop.
Prefer this pattern (or DOM/CSS) whenever you find old <applet> markup.
Edge Cases & Pitfalls
Most “bugs” with <applet> today are expectations that Java still runs.
obsolete
Never use in new pages
Validators and HTML checkers flag <applet>. Plan a rewrite when you find it in production.
security
Plugin risk is why it died
Java applets were a common attack surface. Browsers removed the plugin; do not try to re-enable it.
fallback
Empty body = empty UI
If there is no nested content, users may see nothing useful. Always leave clear fallback (or replace the tag).
API
document.applets is empty
Kept for compatibility; it always returns an empty collection. See document.applets.
migration
object is not a Java fix
HTML once preferred <object> over <applet>, but that still needed a plugin. Use web-native tech instead.
Compatibility
Browser Support
The <applet> element is obsolete. Java Plugin support was removed from all major browsers (e.g. Chrome ~47, Firefox ~56, Safari ~14.1). MDN removed the element docs as irrelevant.
✓ Obsolete · Not supported
<applet>
No functional Java applet support in modern Chrome, Firefox, Safari, Edge, or Opera. Nested fallback content may still appear as plain text.
0%Modern applet runtime
Google ChromePlugin removed (~47+)
Not supported
Mozilla FirefoxPlugin removed (~56+)
Not supported
Apple SafariRemoved (~14.1+)
Not supported
Microsoft EdgeNo Java Plugin
Not supported
OperaPlugin removed
Not supported
Internet ExplorerLegacy plugin only · EOL
Legacy only
<applet>Not supported
Bottom line: Learn <applet> for history and legacy audits only. Build interactive UI with JavaScript, Canvas, CSS, or WebAssembly.
Remember
Key Takeaways
Role:<applet> once embedded Java programs via a browser plugin.
Core attrs:code, width, height, plus codebase, archive, and <param>.
Status: obsolete in HTML5 — do not use in new documents.
Replace with: JavaScript, <canvas>, CSS, or WebAssembly — no plugins.
One line:<applet> is web history — learn it to migrate away, not to build new features.
UA style
Default CSS Settings
When browsers still treated applet as a replaced element, user-agent styling was minimal. A typical idea:
default.css
applet {
display: inline-block;
}
Presentational attributes like align, hspace, and vspace are obsolete — use CSS if you ever restyle legacy markup during migration.
Frequently Asked Questions
The applet element embedded a Java applet — a compiled .class (or JAR) program that ran in the browser through the Java Plugin for games, charts, and demos.
No. applet is obsolete and removed from the HTML Living Standard for authors. Do not use it in new documents.
No. Chrome, Firefox, Safari, Edge, and Opera removed the Java Plugin. You only see fallback content inside the tag (if any).
Use JavaScript with HTML and CSS for UI, canvas or WebGL for graphics, and WebAssembly when you need near-native compute — no browser plugins.
code named the applet’s main .class file. It could be relative to codebase. archive listed JAR files that held classes and resources.
document.applets is kept for compatibility but always returns an empty HTMLCollection because applet support was removed from browsers.