源代码:
下载代码
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> <script> function displayResult(){ document.getElementById("p1").style.unicodeBidi="bidi-override"; } </script> </head> <body> <p>这是一些文本。</p> <p id="p1" style="direction:rtl">这是另一些文本。</p> <br> <button type="button" onclick="displayResult()">覆盖文本</button> </body> </html>
运行结果: