HTML <applet> Applet Tag
Tags: learnhtml
Published: 2021-02-09 16:33:20

---
title: HTML <applet> Applet Tag
published: true
date: 2021-02-09 16:24:21 UTC
tags: LearnHTML
canonical_url: https://sharepointanchor.com/learn-html/html-applet-tag/
---

The **<applet> tag** is used to **embed the java applet into any [HTML](https://sharepointanchor.com/category/learn-html/ "HTML") document**. It contains the attributes that identify the applet to be displayed and give the web browser hints about how it should be displayed.

Note: The <applet> tag is **deprecated in [HTML](https://sharepointanchor.com/category/learn-html/ "HTML") 4.0** and not supported in HTML 5. So you can use the **<object>** tag or **<embed>** tag instead of the **<applet> tag**.

<svg aria-hidden="true" focusable="false" data-icon="clock" width="20" height="20" fill="none" stroke="currentColor" style="display:inline-block;vertical-align:-0.1em" role="img" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>Estimated reading time: 3 minutes

## Syntax:

The <applet> tag has both **opening <applet> tag** and **closing</applet> tag**. The content is written between these two tags.

The use of Java applets is now deprecated as most browsers **no longer support the use of plug-ins** , including the Java plug-in. But some browsers still support the <applet> tag with some additional plug-in.

## Sample of the HTML <applet> Tag:

```

<!DOCTYPE html>
<html>
  <head>
    <title>Applet Tag in HTML</title>
  </head>
  <body>
    <applet code="game.class" align="center" archive="game.zip" height="250" width="350">
      <param name="difficulty" value="easy">
      <b>Sorry, You need Java to play this game.</b>
    </applet>
  </body>
</html>

```

## Result:

![](https://eadn-wc04-3430828.nxedge.io/cdn/wp-content/uploads/2021/02/applet-tag.png)<figcaption>Result</figcaption>

## Attributes:

The following table shows the attributes that are specific to the HTML [applet](https://en.wikipedia.org/wiki/Applet) tag.

| Attributes | Value | Description |
| --- | --- | --- |
| align | Left, Right, Top, Bottom, Middle, Baseline | This attribute is used to **position the applet** according to other elements |
| alt | Text | It helps to create an **alternate text for the applet** |
| archive | URL | It specifies a comma-separated list of URLs that defines an **archive file’s location** |
| code | URL | This attribute will define the **Java applet’s name** |
| object | Name | It helps to define a **reference to a serialized representation of an applet** |
| codebase | URL | Gives a **relative base URL for applets** specified in the code attribute |
| height | Pixels | It specifies the initial **height of the applet’s display area** |
| hspace | Pixels | This attribute defines the amount of **horizontal space around the applet** |
| name | Name | It is used to define a name for the applet |
| vspace | Pixels | Specifies the number of **whitespaces to be reserved on the** **top and bottom side of the applet (Vertical Spaces)** |
| width | Pixels | It will define the **width of an applet** |

<figcaption>Attributes</figcaption>

## Browser Support:

![](https://eadn-wc04-3430828.nxedge.io/cdn/wp-content/uploads/2021/02/Browser-support-4.png)<figcaption>Browser Support</figcaption>

### Related Articles:

- **[HTML <address> Address Tag](https://sharepointanchor.com/learn-html/html-address-tag/)**
- **[HTML <!– Comments –> Tag](https://sharepointanchor.com/learn-html/html-comments-tag/)**
- **[Basic HTML Definitions and Usages in the Real World](https://sharepointanchor.com/learn-html/basic-html-definitions-and-usages-in-real-world/)**
- **[HTML <abbr> Abbreviation Tag](https://sharepointanchor.com/learn-html/html-abbreviation-tag/)**

The post [HTML <code><applet></code> Applet Tag](https://sharepointanchor.com/learn-html/html-applet-tag/) appeared first on [Share Point Anchor](https://sharepointanchor.com).