const para = document.getElementById("para1");
para.dir = "rtl";
// change the text direction on a paragraph identified as "para1"HTMLElement: dir property / notebook
HTMLElement: dir property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.