HTML <applet> tag

The <applet> tag defines the embedded Java applets within an HTML Documents.This tag was supported in HTML 4.01 but hated in HTML earlier Versions but it has completely removed from HTML5 versions. It has been replaced by <object> & <embed> with the coming of HTML5.

Type: Block Element

Example of <applet> tag

<applet code="smoke.class" width="100" height="450">
Java applet goes under here to draw the style of flying smoke.
</applet>
It simply illustrates how <applet> element can perform. We shouldn't cover their entire study since they are no longer valid in HTML5 and not supported by modern browsers.

<applet> element is not supported in HTML5.

Supported Browsers

Tag Chrome Internet Explorer Firefox Safari Opera Mini
<applet> No No Yes Yes No

All attributes of <applet> tag

Attribute names Values Notes
align top
right
bottom
left
middle
baseline
It was used to specify the alignment of an applet with respect to the surrounding contents or elements.
alt text It was used to specify an alternate text for an applet.
archieve URL It specifies the location of JAR (Java Archieve) File containing the code of an applet.
border pixel It specifies border around the applet panel.
code URL It specifies the file name of a Java applet
codebase URL It specifies a relative base URL that contains the application code to be used in an applet element.
height pixel It specifies the display width of a Java applet.
hspace pixel It defines the horizontal spacing around an applet on both sides.
name name It defines the name for an applet which is to be contained in the scripts.
object name It denotes a reference as a representation of an applet.
vspace pixel It defines the vertical spacing around an applet on both sides.
width pixel It specifies the display height of a Java applet.
From the aforementioned attributes, the code and object attributes are mandatory for each Java applet, while the rests are optional attributes.

More reference

We highly recommend not using the <applet> tag in HTML5. It was supported in the earlier versions of Internet Explorer by using additional plug-ins/installations.

Note that <applet> element was supported it HTML 4.01, yet it was rarely used.