在创建这样的新对象时,是否有 jQuery 支持的属性/属性列表:
$('<div/>', {
// these are just examples
"class": "myClass",
text: "Hello World",
click: function(){
var el = $(this),
offset = el.offset(),
info = "L: " + offset.left + ", T: " + offset.top;
el.text(info);
}
}).appendTo('body');