You are here: Reference > HTML > attributes > codeType (applet, object)

codeType attribute (applet, object)

Browser support:
Sets the MIME type (media type) of the application that should be used by the object element.
If you don't specify this attribute, browsers try to determine the application that can be used for the data of the object element. Generally, you don't need to specify this attribute, leaving the choice to the browser.
Use the type attribute, if you want to specify the MIME type of the contents.
JavaScript page for this attribute: codeType. You can find other example(s) there.

Possible values:

String that sets the media type. See the page for the MIME types for more information.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the codeType attribute. The classid attribute specifies the HelloWorld.class file to play and the codeBase parameter sets the path to the HelloWorld.class file. Internet Explorer, Google Chrome and Safari do not support the classid attribute in this form.
<object codetype="application/x-java-applet" classid="java:HelloWorld" width="300px" height="100px">
    <param name="codebase" value="/external/examples/common/java/" />
        Your browser does not support Java applications in this form.
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the codeType attribute in the case when a .wmv file needs to played with Windows Media Player:
<object codetype="application/x-mplayer2" data="testVideo.wmv" width="320px" height="286px">
    <param name="FileName" value="testVideo.wmv" />
        Your browser does not know how to execute Windows Media Player.
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content