HTML DOM dir Attribute
Definition and Usage
The dir attribute sets or returns the text direction of the element.
Syntax:
object.dir=text-direction
Example
This example demonstrates two methods to obtain the text direction of the <body> element:
<html> <body id="myid" dir="rtl"> <script type="text/javascript"> 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>