<html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ p=$("p").clone(); $("button").click(function(){ $("body").append(p); }); }); </script> </head> <body> <p>This is a paragraph.</p> <button>复制每个 p 元素,然后追加到 body 元素</button> </body> </html>
西兰花伟大炮
相关分类