Site icon Dotnet Helpers

.insertAfter() method in Jquery

Description:

The jQuery insertAfter() methods is used to add the contents after the selected elements.

Syntax

Difference between jQuery after() and insertAfter() 

The main difference between after() and insertAfter() method is their syntax and their placement of the target and content location.

Example: 

Output: 

By clicking the button, “this is Newly added text” will append after the selected div (divcontainer).

Exit mobile version