JavaScript Applet Object

The JavaScript Applet object is used to refer to an applet. It is a property of the document object. It has no methods, properties, or events. Applets in the document can be found in the documents applets array. An applet may be referenced as shown below. To reference the first applet in the document.


To reference the applet by name (in cases where the applet tag specifies a name):




Using Applets

An applet may be placed on an HTML page with the following code:

<applet name="ThisApplet" code="ThisApplet.class" WIDTH=150 height=50>

If the applet had a method called printMessage(), it could be invoked with a line like:

document.ThisApplet.printMessage("This is a Test")