HTML <applet> Tag Not Supported in HTML5

Topic: HTML5 Tags Reference« Prev|Next »

Description

The <applet> tag embeds a Java applet (mini Java applications) on the page. An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page.

The following table summarizes the usages context and the version history of this tag.

Placement: Block
Content: Block, inline, and text; any <param> elements must come first
Start/End Tag: Start tag: required, End tag: required
Version: HTML 2, 3.2, 4, 4.01 (transitional)
 

Warning:Do not use this tag since it is a non-standard tag and has been deprecated with all its attributes in HTML 4.01 and obsolete since HTML5. Use the more generic <object> element instead.


Syntax

The basic syntax of the <applet> tag is given with:

HTML / XHTML:
<applet code="URL" width="length" height="length"> ... </applet>

The example below shows the <applet> tag in action.

  • <applet code="Animate.class" width="400" height="300">
  •     <param name="delay" value="30">
  •     <param name="time" value="120">
  • </applet>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <applet> tag.

Attribute Value Description
Required — The following attributes must be specified on this tag for the markup to be valid.
code URL specifies the URL of the applet's class file to be embedded.
width length Specifies the initial width of the applet's display area.
height length Specifies the initial height of the applet's display area.
Optional — The following attributes are optional.
align left
right
top
middle
bottom
Specifies the alignment of <applet> element with respect to the surrounding content.
alt text Provides alternate text if the applet cannot be displayed.
archive URL Specifies a comma-separated list of URLs for archives containing classes and other resources that will be "preloaded".
codebase URL Specifies the URL of the directory where applets' .class files referenced by the code attribute are stored.
hspace pixels Specifies the amount of additional whitespace to be reserved on left and right side of the applet.
name text Specifies the name of the applet.
vspace pixels Specifies the amount of additional whitespace to be reserved on top and bottom side of the applet.

Browser Compatibility

The <applet> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 4+
  • Apple Safari 1+
  • Opera 4+

Further Reading

Related tag: <object>.

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.