Style unicodeBidiProperty

Style 对象参考手册Style Object

Definition and Usage

The unicodeBidi property is used withdirectionthe direction property to set or return whether the text is overridden to support multiple languages in the same document.

Syntax

Set the unicodeBidi property:

Object.style.unicodeBidi="normal|embed|bidi-override|inherit"

Return the unicodeBidi property:

Object.style.unicodeBidi

Value Description
normal Default. Does not use an additional embedding level.
embed Creates an additional embedding level.
bidi-override Creates an additional embedding level. Reordering depends on the direction property.
inherit The value of the unicodeBidi property is inherited from the parent element.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the unicodeBidi property.

Note:IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Override text:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Tutorial (example.com)</title>
<script>
function displayResult(){
    document.getElementById("p1").style.unicodeBidi="bidi-override";
}
</script>
</head>
<body>

<p>This is some text.</p>
<p id="p1" style="direction:rtl">This is some other text.</p>
<br>
<button type="button" onclick="displayResult()">Override text</button>

</body>
</html>

Try it yourself »


Style 对象参考手册Style Object Other Extensions