W3cubDocs

/HTML

<applet>: The Embed Java Applet element

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The obsolete HTML Applet Element (<applet>) embeds a Java applet into the document; this element has been deprecated in favor of <object>.

Use of Java applets on the Web is deprecated; most browsers no longer support use of plug-ins, including the Java plug-in.

Attributes

align Deprecated

This attribute is used to position the applet on the page relative to content that might flow around it. The HTML 4.01 specification defines values of bottom, left, middle, right, and top, whereas Microsoft and Netscape also might support absbottom, absmiddle, baseline, center, and texttop.

alt Deprecated

This attribute causes a descriptive text alternate to be displayed on browsers that do not support Java. Page designers should also remember that content enclosed within the <applet> element may also be rendered as alternative text.

archive Deprecated

This attribute refers to an archived or compressed version of the applet and its associated class files, which might help reduce download time.

code Deprecated

This attribute specifies the URL of the applet's class file to be loaded and executed. Applet filenames are identified by a .class filename extension. The URL specified by code might be relative to the codebase attribute.

codebase Deprecated

This attribute gives the absolute or relative URL of the directory where applets' .class files referenced by the code attribute are stored.

datafld Deprecated

This attribute, supported by Internet Explorer 4 and higher, specifies the column name from the data source object that supplies the bound data. This attribute might be used to specify the various <param> elements passed to the Java applet.

datasrc Deprecated

Like datafld, this attribute is used for data binding under Internet Explorer 4. It indicates the id of the data source object that supplies the data that is bound to the <param> elements associated with the applet.

height Deprecated

This attribute specifies the height, in pixels, that the applet needs.

hspace Deprecated

This attribute specifies additional horizontal space, in pixels, to be reserved on either side of the applet.

mayscript Deprecated

In the Netscape implementation, this attribute allows access to an applet by programs in a scripting language embedded in the document.

name Deprecated

This attribute assigns a name to the applet so that it can be identified by other resources; particularly scripts.

object Deprecated

This attribute specifies the URL of a serialized representation of an applet.

src Deprecated

As defined for Internet Explorer 4 and higher, this attribute specifies a URL for an associated file for the applet. The meaning and use is unclear and not part of the HTML standard.

vspace Deprecated

This attribute specifies additional vertical space, in pixels, to be reserved above and below the applet.

width Deprecated

This attribute specifies in pixels the width that the applet needs.

Example

HTML

<applet
  code="game.class"
  align="left"
  archive="game.zip"
  height="250"
  width="350">
  <param name="difficulty" value="easy" />
  <p>Sorry, you need Java to play this game.</p>
</applet>

Technical summary

Content categories Flow content, phrasing content, embedded content, interactive content, palpable content.
Permitted content Zero or more <param> elements, then transparent.
Tag omission None; both the starting and ending tag are mandatory.
Permitted parents Any element that accepts embedded content.
DOM interface HTMLAppletElement

Specifications

Specification
HTML Standard
# applet

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
applet Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
align Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
alt Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
archive Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
code Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
codebase Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
datafld Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
datasrc Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
height Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
hspace Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
mayscript Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
name Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
object Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
src Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
vspace Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0
width Yes–47 12–79 Yes–56 Yes Yes–34 Yes–14.1 No Yes–47 Yes–56 Yes–34 No Yes–5.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/applet