HTML <applet> tag

The <applet> tag is used to place an applet on a webpage.

NOTE: This tag (as well as all its attributes) is deprecated and is not supported in the XHTML Strict document type.

Attributes

Attribute Possible values Description
align left, right, top, bottom, middle, baseline, texttop, absmiddle, absbottom Sets how an applet will be aligned.
alt altContent Alternative content to be displayed if the applet cannot be run
archive URL URL of the applet when it is stored in a Java Archive or ZIP file
code URL URL of the applet
codebase URL Base URL for applets if specified applet URL is relative
height heightInPixels Sets the height of the applet
hspace spaceInPixels The amount of horizontal space around an applet
name someName Sets a name for an applet
object objectName Name of a resource containing a serialized representation of an applet
vspace spaceInPixels The amount of vertical space around an applet
width widthInPixels Sets the width of the applet

Standard attributes

class, id, style, title

For more information on standard attributes, check out our HTML standard attributes reference page.

Event attributes

NONE

For more information on event attributes, check out our HTML event attributes reference page.

Example

<applet code="mathApplet.class" width="50" height="80"> This applet performs basic arithmetic functions </applet>

Tips & notes

It's better to use the <object> tag for applets (and other embeddable objects like audio and video) than the <applet> tag

If you're going to use the <applet> tag (or the <object> tag for that matter), keep in mind that embedded content like applets, audio, and video take some time to load. This may irritate your visitors who have a slow connection. It's nice to display a message like "Applet may take a few minutes to load, please be patient" in such situations.

Web Reference
  1. CSS reference
  2. RSS reference
  3. HTML reference


© Copyright 2011-2012 Landofcode.com
Terms of use | Privacy policy | Copyright information | Make a donation