• In this article we will explain how to add specified content after the selected element. in jquery
  • or What is after() method in jquery or why use after() method in jquery with example.

  • Description:

The jQuery after() method is used to add specified content after the selected element.

It is just like jQuery append() method. If you want to add content before the selected element,

you should use jQuery before() method.


  • $(selector).after(“content”);

  • Example of jQuery after() method

Let's take an example to demonstrate jQuery after() Method.

<!DOCTYPE html>
    <script src=""></script>
        $(document).ready(function () {
            $("button").click(function () {
    <button>Add content after each p element</button>
    <p>This is a sqltutorials website.</p>
    <p>This is a sqltutorials institute.</p>


how to insert content after selected element in jquery

In above example when we click on button box "<p><b></b></p>"

insert after each of the paragraph.


I hope this article will help to you.


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

you may also like