Javascript examples for DOM:Element dir
Element dir Property - Get the text direction of a <p> element:
<!DOCTYPE html> <html> <body> <p id="myP" dir="rtl">Click the button to display my text direction.</p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w w w. j a v a 2 s . c o m*/ var x = document.getElementById("myP").dir; document.getElementById("demo").innerHTML = x; } </script> </body> </html>