Javascript examples for jQuery Method and Property:jQuery Method Example
delete itself after execution
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-compat-git.js"></script> </head> //from w w w .j a v a2 s . com <body> <button>remove</button> <script id="test"> $( "button" ).click(function() { $( "#test" ).remove(); console.log("removed " + ($( "#test" ).length == 0)); }); </script> </body> </html>