HTML Applet Tag
The <applet> tag is not supported in HTML5 and supported upto HTML 4.01.
The
Syntax -
<applet width="..." height=".." code="file-name.class>
Java Applet is not supported in your browser.
</applet>
| Attribute | Description | Values |
|---|---|---|
| code | Specifies the file name of an applet | URL |
| Object | Specifies a reference of an applet | name |
| align | Specifies the alignment of an applet | left right, top, bottom, middle, baseline |
| Alt | Specifies an alternate text for an applet | Text |
| Archive | Specifies the archive location of applet | URL |
| Height | Specifies the height of the applet | Pixels |
| Name | Specifies the name of the applet | Name |
| Width | Specifies the width of the applet | pixels |
Example -
Scenario - A simple example
<!DOCTYPE html>
<html>
<head>
<title> address example</title>
</head>
<body>
<applet width="150" height="150" code="new.class">
Java applet imported.
</applet>
</body>
</html>
Output -
Explaining Example -
Here, the web page is trying to run a Java applet named new.class. But remember, this will not work in modern browsers anymore.