使用jQuery中append() 方法
$(document).ready(function(){
$(“button”).click(function(){
(
"
b
o
d
y
"
)
.
a
p
p
e
n
d
(
("body").append(
("body").append((“p:first”).clone(true));
});
$(“p”).click(function(){
$(this).animate({fontSize:"+=1px"});
});
});
:first选择器用于获取匹配到的第一个元素,将其封装为jQuery对象并返回。:first选择器等价于:eq(0)选择器。
与:first选择器相对的是:last选择器,用于获取匹配到的最后一个元素。