📅  最后修改于: 2020-11-25 11:39:21             🧑  作者: Mango
jQuery after()方法用于在选定元素之后插入指定的内容。就像jQuery append()方法一样。
如果要在所选元素之前插入内容,则应使用jQuery的before()方法。
句法:
$(selector).after(content,function(index))
Parameter | Description |
---|---|
Content | It is a mandatory parameter. It specifies the content to insert. Its possible values are:
|
Function (index) | It specifies a function that returns the content which is used to insert.
|
让我们看一下jQuery after()方法的示例:
This is a tutorial website.
This is a training institute.
输出:
This is a tutorial website.
This is a training institute.