Home >>jQuery Tutorial >jQuery after() Method

jQuery after() Method

jQuery after() Method

jQuery after() method in jQuery is used to inserts specified content afterselecting the elements.


Parameter Values

Parameter Description
content It is a Required parameter used to insert the specifies content (can contain HTML tags)

Possible values:

  • HTML elements
  • jQuery objects
  • DOM elements
function(index) It is used to returns the specifies content to insert
  • index – used to Returns the set of index position in the element
Here is an Example of jQuery after() Method:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<button class="btn1">click to insert content</button>
<p class="txt">This is a Phptpoint.</p>
<p class="txt">learn here</p>


This is a Phptpoint.

learn here