W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <script src="/jquery/jquery.min.js"></script> </head> <body> <h1>设置文本内容</h1> <h2 id="01">Hello China!</h2> <h2 id="02">Hello World!</h2> <script> $(document).ready(function() { var myElement = $("#02"); myElement.text("Hello Shanghai!"); }); </script> </body> </html>