HTML Tags
HTML <applet> Tag
The <applet> tag once embedded Java applets in web pages, but it is obsolete and removed from HTML5. Modern pages use <object>, <embed>, or <iframe> instead.
The <applet> Tag
The <applet> element was used to embed a Java applet, a small application that ran inside the browser via a Java plugin. Java applets required a browser plugin that modern browsers no longer support.
Because of security problems and the removal of plugin support, <applet> is obsolete. It was deprecated in HTML 4.01 and removed entirely from HTML5.
The <applet> tag is obsolete and must not be used. Java applets no longer run in modern browsers. Embed external content with <iframe>, media with <embed>, or generic resources with <object>.
Syntax (Obsolete)
<!-- Obsolete, does not work in modern browsers -->
<applet code="Game.class" width="300" height="200"></applet>Modern Replacement Example
<!DOCTYPE html>
<html>
<body>
<h1>Embedding modern content with an iframe</h1>
<iframe
src="https://www.wikipedia.org/"
width="100%"
height="300"
title="Embedded Wikipedia">
</iframe>
</body>
</html>More Examples
<!DOCTYPE html>
<html>
<body>
<object data="https://picsum.photos/200" width="200" height="200">
Fallback content if the resource cannot load.
</object>
<p>The object element embeds external resources.</p>
</body>
</html>Key Takeaways
- <applet> is obsolete and removed from HTML5.
- Java applets no longer run in modern browsers.
- Use <iframe> to embed pages, <embed> for media, <object> for generic resources.
- Never use <applet> in new code.
- It was deprecated in HTML 4.01 and dropped in HTML5.
