insert

UK[ɪnˈsɜ:t] US[ɪnˈsɜ:rt]

vt.Insert; embed; (in the article) add; insert

n. Insertion; addition (especially a small picture inserted or overprinted in a page of printed pictures); (book or newspaper) insert; addition

after

UK[ˈɑ:ftə(r)] US[ˈæftə(r)]

prep.…After; (indicates time) after…; (indicates position, order) in …behind

conj.after…

adv.after, following

adj.later,later

jquery insertAfter() method syntax

Function: insertAfter() method inserts HTML tags or existing elements after the selected element. If this method is used on existing elements, the elements will be moved from their current position and added after the selected element.

Syntax: $(content).insertAfter(selector)

## Parameters:

ParameterDescriptioncontent Required. Specifies the content to be inserted. Possible values: Selector expression HTML tag selectorRequired. Specifies where to insert the selected element

jquery insertAfter() method example

<html>
<head>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $("<span>你好!</span>").insertAfter("p");
  });
});
</script>
</head>

<body>
<p>这是一个段落。</p>
<p>这是另一个段落。</p>
<button>在每个 p 元素之后插入 span 元素</button>
</body>
</html>
Run instance »

Click the "Run instance" button to view the online instance