You are here: Reference > JavaScript > client-side > style handling > properties > unicodeBidi

unicodeBidi style property

Browser support:
Specifies or returns whether the text should be overridden to support multiple languages in the same document. Use with the direction property.
This property can override the Unicode standard algorithm of the browser that determines how text should appear when the page contains both RTL (right-to-left) and LTR (left-to-right) text.

Syntax:

object.unicodeBidi;
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: unicode-bidi

Possible values:

The type of this property is string.
 One of the following values: 
bidi-override
Creates an additional level of embedding, but the reordering inside the element depends on the value of the 'direction' property.
embed
Creates an additional level of embedding.
inherit
Takes the value of this property from the computed style of the parent element.
normal
Default. Does not use an additional level of embedding.
Default: normal.

Example HTML code 1:

This example illustrates the use of the unicode-bidi property:
<head>
    <style>
        .normal {
            unicode-bidi: normal;
            direction: rtl;
        }
        .override {
            unicode-bidi: bidi-override;
            direction: rtl;
        }
    </style>
</head>
<body>
    <p class="normal">
        Unicode bidi is normal
    </p>
    <p class="override">
        Unicode bidi is bidi-override
    </p>
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the unicodeBidi property in JavaScript:
<head>
    <script type="text/javascript">
        function ChangeUnicodeBidi (selectTag) {
            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

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

            var div = document.getElementById ("myDiv");
 
            if ('unicodeBidi' in div.style) {
                div.style.unicodeBidi = bidiValue;
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <div id="myDiv" style="direction: rtl;">Change unicode-bidi!</div>

    <br />
    <select size="3" onchange="ChangeUnicodeBidi (this);">
        <option selected="selected" />normal
        <option />embed
        <option />bidi-override
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content