Copyright © tutorialspoint.com

HTML <applet> tag



Advertisements

Function:

The HTML <applet> tag is used for embedding a Java applet within an HTML document.

Difference between HTML and XHTML:

The HTML applet tag is deprecated in HTML 4.01 and is not supported in XHTML (strict DTD). Use the HTML object tag instead.

Example:

<applet code="appletfile.class" width="500" height="650">
Java applet
</applet>

Attributes:

Attribute Value Description
align left
right
top
bottom
middle
baseline
texttop
absmiddle
absbottom
Deprecated - Defines the text alignment around the applet
alt text Alternate text to be displayed in case browser does not support applet
archive URL Applet path when it is stored in a Java Archive ie. jar file
code URL A URL that points to the class of the applet
codebase URL Indicates the base URL of the applet if the code attribute is relative
height pixels Height to display the applet
hspace pixels Deprecated - Defines the left and right spacing around the applet
name name Defines a unique name for the applet
object name Specifies the resource that contains a serialized representation of the applet's state.
title text Additional information to be displayed in tool tip of the mouse
vspace pixels Deprecated - Amount of white space to be inserted above and below the object.
width pixels Width to display the applet.

Standard Attributes:

AttributeDescription
accesskeyAccess keys (or shortcut keys)
classDocument wide identifier
dirSpecifies the direction of the text
idDocument wide identifier
tabindexHelps determine the tabbing order when the user 'tabs' through the elements on the page.
titleSpecifies a title to associate with the element.
styleHelps to include inline casecadubf style sheet.
langSets the language code.

Event Attributes:

AttributeDescription
onclickScript runs when a mouse click
ondblclickScript runs when a mouse double-click
onmousedownScript runs when mouse button is pressed
onmouseupScript runs when mouse button is released
onmouseoverScript runs when mouse pointer moves over an element
onmousemoveScript runs when mouse pointer moves
onmouseoutScript runs when mouse pointer moves out of an element
onkeypressScript runs when key is pressed and released
onkeydownScript runs when key is pressed
onkeyupScript runs when key is released

Copyright © tutorialspoint.com