Erik Beeson schreef:
$('div').each(function(){
    var id= $(this).attr('id');
    $('span').each(function(){
       if(id = $(this).attr('class')){
          alert($(this).text());
       }
    });
});

That attr('class') bit will get you in to trouble. I suggest using
.is(), and in fact, if you know the class you're looking for, you
don't need the second each loop:

$('div').each(function(){
    $('span.' + this.id).doSomethingWithIt();
});

The OP seems a little vague about what the desired result is...

--Erik
Nice catch Erik i was thinking the same after i send it but you reacted first :)

--
David Duymelinck
________________
[EMAIL PROTECTED]

Reply via email to