2 ms·
Shouldn't the second one be: var d = $('div'), a = $('a'); a.each(function(i, el){ d.text(d.text() +' '+ a.eq(i).text() ); }); U
by arethuza 16y ago
Shouldn't the second one be:
var d = $('div'),
a = $('a');
a.each(function(i, el){
d.text(d.text() +' '+ a.eq(i).text() );
});
Using eq(i) rather than index(i)?
- emehrkay 16y agoI feel like this should have been the first replay to my rant. The nodes are already wrapped in the jQuery object, just need to use eq to access them by index. I've never seen that before, thanks