What is the HTML <applet> tag?

In HTMLHypertext Markup Language, the <applet> element can embed simple Java applets in an HTML document. This element depreciated in HTML4, so we use the <object> or <embed> tags in the latest version, HTML5.


Now that browsers do not support Java plugins, <applet> is not supported in HTML5.

Syntax

<!-- basic syntax of HTML applet Tag! -->
<applet attribute1 attribute2 attribute3....>
   <param name='parameter1' value='parameter2'>
   <!-- Code/Content here -->
</applet>

Useful attributes

Attribute Name

Value

Description

code

URL

URL of Java applet Class

alt

Text

Placeholder text

archive

URL

Specify the achieve version of applet

name

Text

Name for applet

hspace

Pixels

Horizontal Spacing

vspace

Pixels

Vertical Spacing

height

Pixels

Display height of applet panel

width

Pixels

Display width of applet panel

align

Index

Position either left, middle, right, top, bottom

Supportability of Browsers

Example

This code helps EdPresso.class Java applet API, which takes name and value as parameters.

  • HTML

HTML <embed> and <object> tags

We can use these tags instead of the<applet> element in HTML5.

In the code below, the highlighted lines illustrate the purpose of these tags and how to use them in your code.

  • HTML

Free Resources