You are here: Reference > JavaScript > client-side > HTML DOM > properties > altHtml (applet, object)
altHtml property (applet, object)
A value for the altHtml property can be specified in an event handler for the onerror event.
For a cross-browser solution, write the HTML content in the object and applet elements.
It has the same effect.
See the examples for details.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is write-only.
Possible values:
String that sets or retrieves the alternate HTML code.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the altHTML property. The alternate HTML content is visible if Java is not installed.
|
|||||
<head> <script type="text/javascript"> function AppletError (applet) { applet.altHtml = "<b>The Java Applet cannot be started!</b>"; } </script> </head> <body> <applet code="HelloWorld.class" codebase="/external/examples/common/java/" onerror="AppletError (this);" style="width:200px; height:50px;"> </applet> </body> |
|||||
|
|||||
Did you find this example helpful?
|
Example HTML code 2:
A cross-browser solution for the previous example:
|
|||||
<body> <applet code="HelloWorld.class" codebase="/external/examples/common/java/" style="width:200px; height:50px;"> <b>The Java Applet cannot be started!</b> </applet> </body> |
|||||
|
|||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments