<html>
<body>
<p>单击该按钮以创建一个 BDO 元素,其中文本从右到左。</p>
<button onclick="myFunction()">试一试</button>
<script>
function myFunction() {
var x = document.createElement("BDO");
var t = document.createTextNode("This text will go right-to-left.");
x.setAttribute("dir", "rtl");
x.appendChild(t);
document.body.appendChild(x);
}
</script>
</body>
</html>