Why doesn't this work in jQuery 1.4.2?
var $list = $([]);
for(var i=0; i<50; i++) {
$list.add( $('<div/>', { id: 'jake', class: 'test' }).data('test', { hi: 'hello' }) );
}
alert($list.size()); // 0
Thanks!
Why doesn't this work in jQuery 1.4.2?
var $list = $([]);
for(var i=0; i<50; i++) {
$list.add( $('<div/>', { id: 'jake', class: 'test' }).data('test', { hi: 'hello' }) );
}
alert($list.size()); // 0
Thanks!
Why add
doesn't work I don't know, but you can replace it with push
due to jQuery being an Array-like object, which should do what you want.