0% found this document useful (0 votes)
26 views3 pages

7.4 Applets in HTML

Uploaded by

mrnirajbro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

7.4 Applets in HTML

Uploaded by

mrnirajbro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

HTML <applet> tag

HTML <applet> tag was used to embed the Java applet in an HTML document. This
element has been deprecated in HTML 4.0 and instead of it we can use <object> and
newly added element <embed>.

The use of Java applet is also deprecated, and most browsers do not support the use of
plugins.

Note: The <applet> tag is deprecated in HTML4.0 and not supported in HTML5. So you can
use <object> tag or <embed> tag instead of <applet>.

Syntax

1. <applet code="URL" height="200" width="100">.............</applet>

Following are some specifications about <applet> tag

Display Block

Start tag/End tag Both Start tag and End tag

Usage Embed Applets

Example

1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title>Applet Tag</title>
5. </head>
6. <body>
7. <p>Example of Applet Tag</p>
8. <applet code="Shapes.class" align="right" height="200" width="300">
9. <b>Sorry! you need Java to see this</b>
10. </applet>
11. </body>
12. </html>
Attributes
Specific Attributes

Attribute Value Description


name

code URL It specifies the URL of Java applet class file.

width pixels It specifies the display width of the applet panel.

height pixels It specifies the display height of applet panel

align o left It specifies the position of applet application relative to


surrounding content.
o right
o top
o middle
o bottom

alt Text It is used to display alternative text in case browser does


not support Java.

archive URL This specifies the archived or compressed version of an


applet application.

object Name It specifies the URL or reference to a serialized


representation of an applet.

codebase URL It specifies the exact or relative URL of applets .class file
specified in the code attribute.

hspace Pixels It specifies the horizontal space around the applet.

vspace Pixels It specifies the vertical space around the applet.

name Name It specifies the name for the applet

You might also like