You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > XvInterpretAs

XvInterpretAs style property

Browser support:
Specifies or retrieves how to interpret the contents of the corresponding element.
Same as the interpret-as property in the CSS3 declaration.

Syntax:

object.XvInterpretAs;
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: -xv-interpret-as

Possible values:

The type of this property is string.
 One of the following values: 
address
Element's content is an address.
currency
Element's content is a currency value.
inherit
Takes the value of this property from the computed style of the parent element.
measure
Element's content is a measurement.
name
Element's content is a proper name of a person, company etc.
net
Element's content is a URI such as an email address or an http URI.
telephone
Element's content is a telephone number.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the -xv-interpret-as property:
<head>
    <style>
        .name {
            -xv-interpret-as: name;
        }
        .telephone {
            -xv-interpret-as: telephone;
        }
        .net {
            -xv-interpret-as: net;
        }
    </style>
</head>
<body>
    <p class="name">Oscar de la Hoya</p>
    <p class="telephone">(212) 907-8686</p>
    <p class="net">www.goldenboysite.us</p>
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the XvInterpretAs property in JavaScript:
<head>
    <style>
        #example {
            -xv-interpret-as: address;
        }
    </style>
    <script type="text/javascript">
        function ChangeIntpr (selectTag) {
            var example = document.getElementById ("example");

            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

            // Returns the text of the selected option
            var selectState = selectTag.options[whichSelected].text;

            if ('XvInterpretAs' in example.style) {
                example.style.XvInterpretAs = selectState;
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <p id="example">615 Dottoro Ave, Webville, AR</p>

    Select the text above, right click and select speak, or change interpret mode:
    <select onchange="ChangeIntpr (this);" size="6">
        <option selected="selected">address</option>
        <option>currency</option>
        <option>measure</option>
        <option>name</option>
        <option>net</option>
        <option>telephone</option>
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content