把所有匹配的元素插入到另一个、指定的元素元素集合的后面。
实际上,使用这个方法是颠倒了常规的$(A).after(B)的操作,即不是把B插入到A后面,而是把A插入到B后面。
返回值
jQuery
参数
content (String) : 用于匹配元素的jQuery表达式
示例
把所有段落插入到一个元素之后。与 $(“#foo”).after(“p”)相同
HTML 代码:<p>I would like to say: </p><div id="foo">Hello</div>
jQuery 代码:$("p").insertAfter("#foo");
结果:<div id="foo">Hello</div><p>I would like to say: </p>