手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

jquery之after的用法

时间:2024-10-12 23:06:41

1、after 有两个参数content 插入到每个目标后的内容function 函数必须返回一个html字符串。

jquery之after的用法

2、示例:在所有段落之后插入一些HTML标记代码。HTML 代码:<p>I would like to say: </p>

jquery之after的用法

3、jQuery 代码:$("p").after("<b>Hello</b>");

jquery之after的用法

4、结果:<p>I would like to say: </p><b>Hello</b>

jquery之after的用法

5、在所有段落之后插入一个DOM元素。HTML 代码:<b id="foo">Hello</b媪青怍牙><p>I would like to say: </p>

jquery之after的用法

6、jQuery 代码:$("p").after( $("#foo")[0] );

jquery之after的用法

7、结果:<p>I would 盟敢势袂like to say: </p><b id="foo">Hello</b>

jquery之after的用法
© 手抄报圈