Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p><bdo id="myBdo" dir="rtl">This paragraph will go right-to-left.</bdo></p>  

<p>Click the button to get the text direction of the text inside the bdo element.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myBdo").dir;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy