Override text in a <p> element:
document.getElementById("myP").style.unicodeBidi = "bidi-override";
<!DOCTYPE html> <html> <body> <p>This is a paragraph.</p> <p id="myP" style="direction:rtl">This is another paragraph.</p> <button type="button" onclick="myFunction()">Override text</button> <script> function myFunction() {//from w w w. java 2 s . c o m document.getElementById("myP").style.unicodeBidi = "bidi-override"; } </script> </body> </html>
The unicodeBidi property works with the direction property to set or get whether the text should be overridden to support multiple languages.
Property Values
Value | Description |
---|---|
normal | Does not use an additional level of embedding. default |
embed | Creates an additional level of embedding |
bidi-override | Creates an additional level of embedding. Reordering depends on the direction property |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
The unicodeBidi property returns a String representing the level of embedding with respect to the bidirectional algorithm.