after mehod in jquery

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $("p").after("Mahak Garg");
  });
});
</script>
</head>

<body>
<h2>This is an Example of after method</h2>
<p>My Name is</p>
<p>I am</p>
<button>Click me!!!</button>
</body>
</html>

Output:

1.png

After we click  on the button:

2.png
Ebook Download
View all
Learn
View all