Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function () { $("button").click(function () { $("p").detach(); $(".myCls").detach(); }); }); </script> </head> <body> <h1>jQuery Manipulation Methods: detach()</h1> <div>This is div tag</div> <span class="myCls">This is span tag</span> <p>This is paragraph </p> <button>Click Here to Test .detach()</button> </body> </html>
Result: