The HTML applet tag is used to make a webpage interactive with animations by embedding Java applets within a web browser. However, the applet tag is no longer used, and we can use <embed> or <object> tags in its place.
The HTML applet tag consists of small programs written in Java that also allow passing parameters. The HTML applet tag supports both Global as well as event attributes. Here, let us learn more about the HTML applet tag.
The HTML applet Tag Syntax
The basic syntax for the HTML applet tag, where you can specify the name of the Java class file to be loaded with “code”, along with the width and height.
| <applet code=”URL” width=”100″ height=”200″>
…. </applet> |
Here, we are using the code attribute, height, and width attributes to embed small programs written in Java within the HTML document.
HTML applet Tag: No Longer Supported With HTML5
The <applet> tag is no longer supported with HTML5 and has been deprecated in HTML 4.01. You can use other alternatives available, such as <embed> and the <object> tags.

However, you can still use the <applet> tag along with some additional plugins or installations to make it work. The HTML applet tag is used to define an embedded applet i,e. plugin. Plugins are programs that extend the standard functionality of the browser.
- Most browsers no longer support the Applet tag and plug-ins
- Shockwave Flash is also not supported on modern browsers.
- ActiveX controls are also not supported for browsers.
If you have to embed a video, you can use the simple <video> tag, and if you want to embed an audio, you can use the <audio> tag. To embed objects, you can either use the <object> tag or the <embed> tag.
Read More: Applet In Java Program: Examples, Types
The HTML applet Tag
The <applet> tag in HTML is used to embed Java applets into any HTML document. The <applet> tag is no longer supported in HTML5 as it was deprecated in HTML 4.01. You can also specify parameters using the <param> tag along with its values.
It defines an embedded applet that is supported on all major browsers, including Internet Explorer, Chrome, Opera, Firefox, and more. Some of the standard attributes supported with the HTML applet tag are mentioned below.
- id
- class
- title
- style
- lang
- dir
- accesskey
Some of the event attributes supported are mentioned below.
- onclick
- onmousedown
- onmouseup
- onmouseover
- onmousemove
- onmouseout
- onekeydown
- onekeyup
Let us check some of the frequently used attributes with the HTML applet tag below.
Attributes in HTML Applet Tag
The HTML applet tag supports both the global as well as event attributes. Check some of the major tags below.
| Attribute | Value |
| align | left
right top bottom middle |
| alt | text |
| archive | URL |
| code | URL |
| codebase | URL |
| height | pixels |
| hspace | pixels |
| name | name |
| object | name |
| vspace | pixels |
| width | pixels |
1. align attribute
The align attribute is used with Applet, and it defines how text or other elements are aligned around the applet on the webpage. It can take values like left, right, top, bottom, and middle.
For example, if you set align=”left”, the applet will appear on the left side, and text will wrap around it.
| <applet code=”Demo.class” width=”200″ height=”100″ align=”left”></applet> |
Read More: HTML DOCTYPE Declaration: Major Highlights For Document Type Declaration 2025
2. alt attribute
The alt attribute in HTML is used to provide alternative text displayed when the browser does not support Java applets. It improves accessibility and gives users context when the applet cannot be loaded.
| <applet code=”Demo.class” width=”200″ height=”100″ alt=”Java applet not supported”></applet> |
3. archive attribute
This attribute is used to specify the path to a Java Archive file that contains the related files along with the applet. It helps browsers load all required files from one compressed JAR file instead of multiple class files.
| <applet code=”Demo.class” archive=”demo.jar” width=”200″ height=”100″></applet> |
4. code
This applet attribute specifies the name of the Java class file that contains the Java bytecode. It tells the browser which class to load and execute while loading the applet.
| <applet code=”HelloWorld.class” width=”200″ height=”100″></applet> |
Read More: Top 30 HTML Interview Questions and Answers 2025
5. codebase
The codebase attribute defines the base URL where the class file of the applet is located. It helps locate the code attribute properly when it uses a relative path.
| <applet code=”HelloWorld.class” codebase=”https://example.com/applets/” width=”200″ height=”100″></applet> |
6. height
The height attribute is used to specify the vertical dimension of the space allocated for the applet on the webpage. It displays how tall the area of the Applet will appear.
| <applet code=”Demo.class” width=”300″ height=”200″></applet> |
7. hspace
The hspace attribute is used to define the horizontal space to be left on the left and right sides of the applet. It adds padding around the applet horizontally.
| <applet code=”Demo.class” width=”200″ height=”100″ hspace=”10″></applet> |
8. name
The name attribute is used to assign a unique identifier to the applet. It allows the applet to be referenced from JavaScript.
| <applet code=”Demo.class” name=”myApplet” width=”200″ height=”100″></applet> |
9. vspace
The vspace attribute is used to define the vertical white space above and below the applet.
| <applet code=”Demo.class” width=”200″ height=”100″ vspace=”20″></applet> |
The <param> Tag In HTML applet Tag

The <param> tag is used inside the HTML applet tag to send custom input values from HTML to Java programs that run in the browser. It passes parameters to a Java applet.
| <applet code=”AppletClassName.class” width=”300″ height=”200″>
<param name=”parameterName” value=”parameterValue”> </applet> |
The applet Java code can read these parameters listed inside the HTML applet tag.
- name: It tells the name of the parameter that is to be passed to the applet.
- value: It specifies the value assigned to the parameter.
Learn Full Stack Web Development With PW Skills
Enroll in our 6 months Full Stack Web Development Course with PW Skills and strengthen your chances of making a strong career in web development. Master frontend and backend frameworks and build web applications using these frameworks and tools available.
Get delved into in-depth learnings, interactive classes, flexible timings and more with this fun learning platform. Build interactive projects, module level assignments, assessments, and quizzes to master your web development concept. Get doubt support and interview preparation assistance with PW Skills dedicated mentors on the platform. Learn more about the complete web development only on pwskills.com
HTML Applet Tag FAQs
Q1. What is the HTML applet tag?
Ans: The HTML applet tag is used to embed Java applets, which are used to add animations, videos, audio, documents, and more to the webpage and make it interactive.
Q2. What is the use of applet tags in HTML?
Ans: The tag in HTML is used to embed Java applets into any HTML document.
Q3. Is the applet no longer supported on HTML5?
Ans: HTML applet tags are no longer supported on HTML5, since it was deprecated in HTML 4.01. You can either use , object>, audio>, or video> tags to embed plugins in an HTML document.
Q4. What is the attribute in an HTML applet?
Ans: The attribute in the tag is used to pass parameters to an applet from an HTML page. It lets you send custom input values to the Java program, which runs on the browser.
