You are here: Reference > JavaScript > client-side > HTML DOM > properties > type (param)

type property (param)

Browser support:
Specifies or returns the MIME type of the resource referenced by the value property. The type property can be used only if the value of the valueType property is set to 'ref'.

Syntax:

object.type;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: type

Possible values:

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

Example HTML code 1:

This example illustrates the use of the type attribute with Windows Media Player:
<object type="application/x-mplayer2" data="testVideo.wmv" width="320px" height="286px">
    <param name="src" value="testVideo.wmv" valuetype="ref" type="video/x-ms-wmv" />
</object>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the type property with Windows Media Player:
<head>
    <script type="text/javascript">
        function GetParamType () {
            var videoFile = document.getElementById ("videoFile");
            alert (videoFile.type);
        }
    </script>
</head>
<body>
    <object type="application/x-mplayer2" data="testVideo.wmv"  width="320px" height="286px">
        <param id="videoFile" name="src" value="testVideo.wmv" valuetype="ref" type="video/x-ms-wmv"/>
    </object>

    <button onclick="GetParamType ();">Get the MIME type of the video!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content