W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".btn1").click(function(){ $("p").empty(); }); }); </script> </head> <body> <p style="width:200px;height:200px;background-color:yellow">This is a paragraph. <b>Bold</b> and <i>italic</i> text.</p> <button class="btn1">删除 p 元素的内容</button> </body> </html>