The jQuery .after() API allows you to insert content after the specified elements. It is similar to the .insertAfter() method, but the syntax is a bit different.

<div id="welcomeBox">
    <h3>Welcome to our site.</h3>

var clientName = "George Abernathy";
$("#welcomeBox h2").after("<h2>" + clientName + "</h2>");  

The .after() method finds all of the instances of what has been specified with the selector, then inserts the contents of the parentheses into the HTML after the selector. This can be done for one instance on the page, or it can place this content into several locations.

The .after() method is great for personalizing web pages on the fly.

Three dot cartouche

Methods similar to .after()

The .after() method is very useful and allows you to add something after a specified element. There are other methods that might work a little bit better for certain similar situations.

♦ .insertAfter() the syntax for this method is different in that the selector is what is inserted after what is in the parentheses for the method

♦ .append() this method will add content to the end of what already exists 

♦ .html() this method will allow you to insert HTML content into a specified element or retrieve the HTML content of that element for other uses.