HTML Tags

HTML <applet> Tag

The <applet> tag in HTML was used to embed Java applets (small Java programs) into a web page.
Applets could display interactive graphics, animations, or run other Java-based functionalities directly within the browser.
However, the <applet> tag is deprecated in HTML5 and should no longer be used — it has been replaced by the <object> or <embed> tag.

Syntax

<applet code="ClassFileName.class" width="300" height="200">
  Your browser does not support Java applets.
</applet>

Attributes

AttributeDescription
codeSpecifies the name of the Java class file to be loaded.
archiveSpecifies the location of the applet’s .jar file.
codebaseDefines the base URL for the applet’s class files.
widthSpecifies the display width of the applet.
heightSpecifies the display height of the applet.
nameAssigns a name to the applet instance.
altProvides alternate text for browsers that do not support Java applets.
objectSpecifies the serialized applet object.
alignDefines alignment relative to surrounding elements.
hspaceSets horizontal space around the applet.
vspaceSets vertical space around the applet.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Applet Tag Example</title>
</head>
<body>

<h2>HTML &lt;applet&gt; Tag Example</h2>

<applet code="HelloWorld.class" width="300" height="200">
  Your browser does not support Java applets.
</applet>

<p><strong>Note:</strong> Modern browsers no longer support Java applets. Use the &lt;object&gt; tag instead.</p>

</body>
</html>

Output

Browser Output

There is no visible output in modern browsers because Java applets are no longer supported.
To experience similar functionality, you can embed JavaScript or use the <object> tag instead.
Please use our TryIt Editor to test HTML structure (output will not render).

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
❌No❌No❌No❌No❌No⚠️Partial

No browser support this <applet> tag now except of some older version of IE.

Notes

  • The <applet> tag was officially deprecated in HTML 4.01 and removed in HTML5.
  • Java plug-ins are now considered insecure and have been removed from most browsers.
  • For modern replacements, use <object>, <embed>, or JavaScript-based web apps.

Conclusion

The <applet> tag was used to embed Java programs directly into web pages but is now obsolete.
Modern web development standards have replaced it with safer and more compatible technologies like JavaScript, <object>, <embed>, or WebAssembly.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend