输入banner图图片脚本导航/分类

jQuery中after的两种用法实例_jquery

法一:
在每个p元素后插入内容:
代码如下:

$("button").click(function(){
$("p").after("

Hello world!

");
});

法二:
代码如下:

$("button").click(function(){
$("p").after(function(n){
return "

The p element above has index " + n + "

";
});
});

after中函数必须返回一个html字符串。