<!DOCTYPE html>
<html>
<body dir="rtl">
<h1>The Element Object</h1>
<h2>The dir Property</h2>
<p>My text direction is:</p>
<p id="demo"></p>
<script>
var x = document.body.dir;
document.getElementById("demo").innerHTML = x;
</script>
</body>
</html>