🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

<applet>

AI & DATA SCIENCE // applet-tag

The deprecated <applet> element embedded a Java applet in a page; it has been fully removed from the HTML5 spec in favor of <object> or, more practically, modern JavaScript/WebAssembly.

Syntax

<!-- Deprecated and removed from HTML5: -->
<applet code="MyApplet.class" width="200" height="200"></applet>

Deep Dive Course

**`<applet>`** was used in the 1990s and early 2000s to embed small Java programs ('applets') that ran inside the browser via a Java plugin. Both the element and the underlying Java-applet plugin technology have been fully abandoned: HTML5 formally removed `<applet>` from the spec, and no current browser includes Java plugin support at all (major browsers dropped NPAPI plugin support entirely years ago, and Oracle itself deprecated the Java Applet API). Any `<applet>` markup found today is purely a historical artifact with zero functional effect.

1Understanding <applet>

`<applet>` was used in the 1990s and early 2000s to embed small Java programs ('applets') that ran inside the browser via a Java plugin. Both the element and the underlying Java-applet plugin technology have been fully abandoned: HTML5 formally removed <applet> from the spec, and no current browser includes Java plugin support at all (major browsers dropped NPAPI plugin support entirely years ago, and Oracle itself deprecated the Java Applet API). Any <applet> markup found today is purely a historical artifact with zero functional effect.

💡

If you ever encounter <applet> in genuinely old code, know that it simply won't run in any browser released in the last decade or so — the entire underlying Java-plugin technology it depended on no longer exists in browsers.

editor.html
<!-- Historical example, non-functional in any modern browser -->
<applet code="Clock.class" width="150" height="150"></applet>
localhost:3000

2Practical Example

Here is a real-world application of <applet> showing how it is used in production HTML.

editor.html
<!-- Modern equivalent of interactive in-browser functionality: plain JavaScript -->
<canvas id="clock" width="150" height="150"></canvas>
<script>
  // Draw and update a clock using the Canvas API instead of a Java applet
</script>
localhost:3000

3Best Practices

Follow these guidelines when working with <applet>:

1. Never use <applet> — it's entirely removed from the HTML5 spec and non-functional in every modern browser

2. If migrating legacy Java-applet functionality, it needs to be rebuilt with modern JavaScript, WebAssembly, or a server-side equivalent — there's no direct drop-in browser replacement

3. Treat any <applet> found in old code as dead, non-functional markup to be removed

⚠️

Tip: If you ever encounter <applet> in genuinely old code, know that it simply won't run in any browser released in the last decade or so — the entire underlying Java-plugin technology it depended on no longer exists in browsers.

editor.html
<!-- Historical example, non-functional in any modern browser -->
<applet code="Clock.class" width="150" height="150"></applet>
localhost:3000

Examples

Example 01Basic Usage
<!-- Historical example, non-functional in any modern browser -->
<applet code="Clock.class" width="150" height="150"></applet>
Example 02Advanced Example
<!-- Modern equivalent of interactive in-browser functionality: plain JavaScript -->
<canvas id="clock" width="150" height="150"></canvas>
<script>
  // Draw and update a clock using the Canvas API instead of a Java applet
</script>

Best Practices

  • Never use — it's entirely removed from the HTML5 spec and non-functional in every modern browser
  • If migrating legacy Java-applet functionality, it needs to be rebuilt with modern JavaScript, WebAssembly, or a server-side equivalent — there's no direct drop-in browser replacement
  • Treat any found in old code as dead, non-functional markup to be removed

    Interview Question

    Why can't <applet>-based content be 'fixed' by just updating the browser, unlike some other deprecated HTML elements?

    Hint: Think about what <applet> actually depended on beyond just the HTML tag itself.

    Unlike purely presentational deprecated tags (like <center> or <font>, which just lose their default styling but the text/content still displays), <applet> depended entirely on an external Java-plugin runtime being installed and supported by the browser to execute the embedded program. Browsers removed plugin architecture (NPAPI) support entirely years ago, so there's no code path left for a browser update to restore — the content requires a full rewrite using modern web technology (JavaScript, WebAssembly, Canvas/WebGL) to work again.

    Exercises

    EasyPractice using <applet> in a real scenario.
    View Solution
    <!-- Historical example, non-functional in any modern browser -->
    <applet code="Clock.class" width="150" height="150"></applet>

    Frequently Asked Questions

    Why can't <applet>-based content be 'fixed' by just updating the browser, unlike some other deprecated HTML elements?

    Unlike purely presentational deprecated tags (like

    or , which just lose their default styling but the text/content still displays), depended entirely on an external Java-plugin runtime being installed and supported by the browser to execute the embedded program. Browsers removed plugin architecture (NPAPI) support entirely years ago, so there's no code path left for a browser update to restore — the content requires a full rewrite using modern web technology (JavaScript, WebAssembly, Canvas/WebGL) to work again.

    Related Functions

    object-tag