<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Removing the Elements from DOM in jQuery</title> <style> .container{ padding: 16px; background: skyblue; border: 5px solid green; } </style> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ // Removes heading with class "hint" from DOM on button click $("button").click(function(){ $("p.hint").remove(); }); }); </script> </head> <body> <div class="container"> <h1>Happy Morning!</h1> <p>A sample paragraph</p> <p class="hint"><strong>Note:</strong> If you choose to click the button below, it will delete this Heading.</p> <button type="button">Remove Hint</button> </div> </body> </html>