There is no big difference between those functions except the syntax:
$(\'.target\').append(\'text\'); $(\'text\').appendTo(\'.target\');
A
When you are creating an element, it's smoother to use .appendTo equivalents
.appendTo
$("", {text: "hello"}).appendTo("body"); vs $("body").append( $("", {text: "hello" }) /*Awkward having to call jQuery constructor here*/); 0 讨论(0) 查看其它7个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
vs
$("body").append( $("", {text: "hello" }) /*Awkward having to call jQuery constructor here*/); 0 讨论(0) 查看其它7个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复