<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>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_bdo_dir2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:17:09 GMT -->
</html>