Edit in JSFiddle

$(document).ready(function () {
                $("#detach").click(function () {
                    $("#targetP").detach();
                });
            });
<html>
        <head>
        <title>detach</title>
        </head>
        <body>
        <p id="targetP">This is 99codingexample.</p><br />
        <input type="button" id="detach" value="Detach"/>
        <input type="button" id="reset" value="Reset" onclick="location.reload()" />
        </body>
        </html>