Syntax | This element uses separate opening and closing tags.<applet>...</applet> |
---|---|
Usage | The <applet> tag is used to embed a Java applet into the web page. The content that is placed between the opening and closing tags serves as alternate information that can be displayed by browsers that do not support the <applet> tag, or for browsers that that have this feature disabled. This tag has been deprecated and can be replaced using the <object> tag. The <applet> tag must use either the code attribute or the object attribute. <applet> example: <applet code="swimmingfish.class" height="200" width="200">Swimming Fish</applet> Alternative example using the <object> tag as a replacement for the <applet> tag: <object codetype="application/java" classid="java:swimmingfish.class" |
Content Model | The <applet> element can contain the following tags, and Text, between its opening and closing tags. <a>
<abbr>
<acronym>
<address>
<applet>
<b>
<basefont>
<bdo>
<big>
<blockquote>
<br>
<button>
<center>
<cite>
<code>
<del>
<dfn>
<dir>
<div>
<dl>
<em>
<fieldset>
<font>
<form>
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<hr>
<i>
<iframe>1
<img>
<input>
<ins>
<isindex>
<kbd>
<label>
<map>
<menu>
<noframes>2
<noscript>
<object>
<ol>
<p>
<param>
<pre>
<q>
<s>
<samp>
<script>
<select>
<small>
<span>
<strike>
<strong>
<sub>
<sup>
<table>
<textarea>
<tt>
<u>
<ul>
<var>
Notes:1. The <applet> element can contain the <iframe> tag when using DTD Transitional and Frameset documents but not Strict documents. 2. The <applet> element can contain the <noframes> tag when using DTD Transitional documents but not Strict or Frameset documents. 3. Red tags have been deprecated and are allowed in DTD Transitional and Frameset documents but not Strict documents. |
Required | Tag Specific | Core | Focus | Events | Language |
---|---|---|---|---|---|
height width | align alt archive code codebase hspace name object vspace | id class style title |
Attribute | Description |
---|---|
height | The height attribute specifies the initial height, in pixels, of the applet. Note: This is a required attribute. Note: This attribute has been deprecated. |
width | The width attribute specifies the initial width, in pixels, of the applet. Note: This is a required attribute. Note: This attribute has been deprecated. |
align | The align attribute specifies the position of the applet. A value of "bottom", "middle", or "top" specifies the position with respect to surrounding text. a value of "left" or "right" will float the applet to the left or right. Note: This attribute has been deprecated. |
alt | The alt attribute is used to specify alternate text to be displayed in the event that the browser is not enabled to display the applet. Note: This attribute has been deprecated. |
archive | The archive attribute specifies a comma separated list of URLs for resources to be preloaded in order to improve the performance of the applet. Note: This attribute has been deprecated. |
code | The code attribute is used to specify the path to the applet class or it specifies the name of the file that contains the applet's subclass. Note: This attribute has been deprecated. |
codebase | The codebase attribute is used to specify a base URL for the applet. If a base URL is specified then the code, archive, and object attributes can use URLs that are relative to the specified base URL. Note: This attribute has been deprecated. |
hspace | The hspace attribute specifies the amount of white space, in pixels, to the left and right of the applet. Note: This attribute has been deprecated. |
name | The name attribute is used to specify a name for the applet. Applets on the same web page can use this name to find each other. Note: This attribute has been deprecated. |
object | The object attribute specifies the name of a resource. The resource contains the serialized representation of the applet's state. Note: This attribute has been deprecated. |
vspace | The vspace attribute specifies the amount of white space, in pixels, to the top and bottom of the applet. Note: This attribute has been deprecated. |
id | The id attribute assigns a unique name to a tag. This allows style sheets or scripts to reference the tag. See id Example |
class | The class attribute assigns a class name to a tag. The class name does not need to be unique. More than one tag can have the same class name. This allows style sheets or scripts to reference multiple tags with a single class name. See class Example |
style | The style attribute specifies styles for the tag. For Cascading Style Sheets (CSS), the syntax is name:value. Each name:value pair is separated by semicolons. See style Example |
title | The title attribute specifies additional information about the tag. It is common for browsers to display the title when the pointing device stops over the object. See title Example |