dir


dir 属性设置或返回元素的文本方向。

HTMLElementObject.dir=text-direction

实例 

返回 body 元素的文本方向:

<html>
 <body id="myid" dir="rtl">

 <script>
 var x=document.getElementsByTagName('body')[0];
 document.write("Text direction: " + x.dir);
 document.write("<br>");
 document.write("An alternate way: ");
 document.write(document.getElementById('myid').dir);
 </script>

 </body>
</html>