You are here: Reference > JavaScript > client-side > HTML DOM > properties > units (embed)

units property (embed)

Browser support:
Specifies or returns the measurement system used for the height and width properties of an embed object.
The embed tag is a non-standard tag in HTML but supported by all commonly used browsers.

Syntax:

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

Possible values:

String that sets or retrieves the measurement system.
One of the following values:
em
Width and height values are relative to the size of the current font.
px
Explorer default. Width and height values are in pixels.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the units attribute:
<embed id="myEmbed" type="application/x-mplayer2" src="testVideo.wmv" 
        style="width:320px; height:286px;" units="em" />
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the units property:
<head>
    <script type="text/javascript">
        function GetUnits () {
            var embed = document.getElementById ("myEmbed");

            if ('units' in embed) {
                alert (embed.units);
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <embed id="myEmbed" type="application/x-mplayer2" src="testVideo.wmv" 
            style="width:320px; height:286px;" units="em" />
    <br />

    <button onclick="GetUnits ();">Get width and height units!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content