Code has been added to clipboard!

applet HTML Tag

Reading time 2 min
Published Jun 29, 2017
Updated Oct 2, 2019

applet HTML: Main Tips

  • The <applet> HTML used to embed Java applets into HTML files.
  • For embedding Java applet, HTML no longer recommends using the <applet> element.
  • Better options to learn how to use Java in HTML include <object> and <embed> elements.

How applet Was Used

The <applet> HTML element adds a Java applet to an HTML document. In the following example, Java applet draws a chess game:

Example
<applet code="chess.class">
  <p>You need Java to enjoy this game.<p>
</applet>

Warning: do not use this element for incorporating Java applet: HTML 5 removed this element and offers <object> and <embed> as alternatives.

Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid certificates of completion
Coursera
Pros
  • Professional service
  • Flexible timetables
  • A variety of features to choose from
Main Features
  • Professional certificates of completion
  • University-level courses
  • Multiple Online degree programs
Datacamp
Pros
  • Great user experience
  • Offers quality content
  • Very transparent with their pricing
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable

Deprecated Attributes

code

It defined the URL of the class file of a Java applet.

Example
<applet code="chessgame.class">
  You need Java to play this game.
</applet>

align

It specified the alignment of an applet.

Example
<applet code="racing.class" align="center">
  You need Java to play this game.
</applet>

alt

It set an alternate text to an applet.

Example
<applet code="chess.class" alt="HTML applet example">
  This Java applet draws a chess game.
</applet>

archive

It indicated the location of a compressed or archived version of the applet.

Example
<applet archive="gamefiles.zip" code="chess.class">
  Sorry, you need Java to play this game.
</applet>

height

It defined the height of the applet (in pixels).

Example
<applet height="350" width="550" code="chatroom.class">
  This Java applet draws an online chatroom.
</applet>

width

It indicated the width of the applet (in pixels).

Example
<applet height="350" width="550" code="chatroom.class">
  This Java applet draws an online chatroom.
</applet>

name

It set a name to the Java applet.

Example
<applet name="chess" code="chessgame.class" height="350" width="550">
  This Java applet draws a chess game.
</applet>

Browser support

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
All
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile browser support

Browser image
Chrome
All
Browser image
Firefox
All
Browser image
Opera
All
Browser image
Safari
-

Latest Udacity Coupon Found:

Verified STAFF PICK

75% OFF COURSES

Udacity Black Friday Offer

The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!

Expiration date: 03/03/2021
3176 People Used
Only 97 Left
Rating
5.0