You are here: Reference > HTML > tags > applet

applet element

Browser support:
Allows embedding a Java applet.
The applet element is deprecated. Use the object element instead.
If you want to see the HTML tags by categories, please visit this page.
This element requires a closing tag.
JavaScript page for this element: applet.

Possible members:

Attributes
Events
Styles
Pseudos
accessKey
Sets an access key to an element.
align
Sets the object's position with respect to the surrounding text.
alt
Sets an alternate text that is displayed when the file associated with the element cannot be displayed.
archive
Sets a space-separated list of URLs for archive files.
border
Sets the thickness of the border.
class
Sets the style class or classes that belong to the element.
classid
Sets the class identifier of the embedded application.
code
Sets the name of the Java class file that contains the Java applet.
codeBase
Sets the base location that relative URLs specified in the classid, data and archive attributes are relative to.
codeType
Sets the MIME type (media type) of the application that should be used by the object element.
contentEditable
3
Sets whether the contents of the object are editable.
dataFormatAs
Specifies how data is to be rendered.
DECLARE
Sets whether an object is only a declaration (it isn't downloaded until it's needed).
dir
Sets the text direction as related to the lang attribute.
DISABLED
Sets the state of an object for user interaction.
draggable
3.55
Sets whether an element is draggable.
height
Specifies the height of an element.
HIDEFOCUS
Specifies whether a dotted rectangle (focus rectangle) is drawn around an object while it has focus.
hSpace
Specifies the number of pixels to use as a margin at the left and right sides of the object.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
language
Sets the scripting language for the current element. Use it only for the script element.
MAYSCRIPT
Indicates whether the Java applet is allowed to access the scripting objects of the web page.
name
Sets the name of an element.
standby
Specifies a text message that will be displayed while the object is loading.
style
Sets an inline style associated with an element.
tabIndex
Specifies the tabbing order for keyboard navigation using the TAB key.
title
Specifies a tooltip for an element.
type
Specifies the content type (MIME type) of the object or the linked object.
unSelectable
Sets whether the selection process can start in an element's content.
useMap
Sets the URL to use as an image map.
vSpace
Specifies the number of pixels to use as a margin at the top and bottom sides of an object.
width
Specifies the default width of the element.

Example HTML code 1:

This example illustrates the use of the applet element:
Code
HelloWorld.java
<applet code="HelloWorld.class" codebase="/external/examples/common/java/" style="width:200px; height:50px;">
</applet>
Did you find this example helpful? yes no

Example HTML code 2:

Recommendation:
Code
HelloWorld.java
<object classid="clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA" width="300px" height="100px"
        codebase="http://java.sun.com/products/plugin/autodl/jinstall">
    <param name="type" value="application/x-java-applet" /> <!-- Opera, Google Chrome and Safari use the type parameter, instead of the clsid -->
    <param name="code" value="HelloWorld.class" />
    <param name="codebase" value="/external/examples/common/java/" />

        <!-- Firefox needs codetype, classid pair in the following form -->
    <object codetype="application/x-java-applet" classid="java:HelloWorld" width="300px" height="100px">
        <param name="codebase" value="/external/examples/common/java/" />
            Your browser does not know how to execute Java applications.
    </object>
</object>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content