Skip to content
Tutorials Center
My learning

Topics

HTML Reference ยท Obsolete Elements

The <applet> element (obsolete)

The HTML <applet> element embedded Java applets and is obsolete. Learn why browsers dropped Java and what to use today, with a before and after example.

The <applet> element embedded a Java applet: a small Java program that ran inside the page through a browser plugin. Attributes such as code, archive, width and height told the plugin which class to load and how much room to give it, and <param> children passed in settings.

Why it's obsolete

HTML 4 already preferred <object> for applets, and HTML5 made <applet> obsolete. The bigger change came later: browsers removed support for plugins of this kind between roughly 2015 and 2017, and Java applets went with them because of their long history of security problems and their poor fit for mobile devices.

Today browsers treat <applet> as an unknown element. Nothing runs; any text between the tags simply shows up as ordinary content.

Modern replacement

There is no drop-in replacement element. Rebuild the feature with HTML, CSS and JavaScript (or <canvas> for graphics), or compile existing code to WebAssembly.

HTML
<!-- Before: obsolete, no longer runs anywhere -->
<applet code="Clock.class" width="200" height="60">
  <param name="zone" value="UTC">
  Your browser cannot run Java.
</applet>
After: the same idea in JavaScript

Technical summary

Status Obsolete (non-conforming)
Replacement HTML, CSS and JavaScript, <canvas> or WebAssembly
Still rendered by browsers No; treated as an unknown element, so only its fallback text shows