CodeLab
Show Output
 
 
 
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="utf-8">
5
<title>jQuery remove()</title>
6
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
7
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
8
<script>
9
$(document).ready(function() {
10
  $("#button").click(function() {
11
     $("p").remove();
12
  });
13
});
14
</script>
15
</head>
16
<body>
17
 <p>This is first paragraph. </p>
18
 <button style="margin:0 0 10px 0;background:#e8e8e8;" class="btn" id="button">Click here</button><br />
19
 </body>
20
</html>                            
 

Share this example with Facebook, Twitter