Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>本教程(w3big.com)</title> <script src="http://cdn.static.w3big.com/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").unwrap(); }); }); </script> <style> div{background-color:yellow;} article{background-color:pink;} </style> </head> <body> <div> <p>这是一个div元素中的段落。</p> </div> <article> <p>这是一个在文章元素的段落。</p> </article> <button>移除每个p元素的父元素</button> </body> </html>