The applets array of the Document object contains objects that represent the applets embedded in the document with the <applet> or <object> tag. An applet is a portable, secure Java program that is loaded over the Internet and executed by the web browser; both Netscape and Internet Explorer support Java (although IE 6 no longer includes Java support by default).
<applet name="animation" code="Animation.class" width="500" height="200"> </applet> <form> <input type="button" value="Start" onclick="document.animation.start( );"> <input type="button" value="Stop" onclick="document.animation.stop( );"> </form>
All applets define start( ) and stop( ) methods. In this hypothetical example, the methods cause an animation to start and stop; by defining the HTML form, we've given the user control over starting and stopping the applet. Note that we've used the name attribute of the <applet> tag, so we can refer to the applet by name, rather than as a numbered element of the applets array.