<html>
<body>
<h1>The Element Object</h1>
<h2>The dir Property</h2>
<p id="myP">Click "Try it" to change my text direction.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("myP").dir = "rtl";
}
</script>
</body>
</html>