given object stores li elements, want find ids:
$($selected).each(function(){ console.log($selected.attr('id')); $(this).fadeout(function(){ $(this).appendto($list).removeclass("ui-state-highlight").fadein(); }); }); } this giving me first. why?
that's because calling attr method on $selected object , attr returns id of first selected element in jquery collection, should use this.id or $(this).prop('id') in each callback.
$selected.each(function(index, element) { console.log(this.id); // ... })
Comments
Post a Comment