jquery ??() ??? ???
??: remove() ???? ?? ??? ? ?? ??? ???? ??? ??? ?????. ? ???? jQuery ???? ???? ??? ???? ???? ??? ???? ??? ???? ? ????. ??? ??()? ?? ??? ???? ??? jQuery ???? ???? ????. ???? ???, ?? ??? ?? ?? ?? ??? ?????. ?? detach()? ????.
??: ??$(selector).remove()
jquery ??() ??? ?
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").remove(); }); }); </script> </head> <body> <p>這是一個(gè)段落。</p> <p>這是另一個(gè)段落。</p> <button>刪除所有 p 元素</button> </body> </html>
??? ????? ??? "???? ??" ??? ?????