$('div').each(function(){
var text = $(this).text();
$('span').each(function(){
if(text == $(this).text()){
alert('found '+text);
}
});
});
This code will not get you the subsequent siblings but it will get you
the span with the same content as the div.
If you want the subsequent sibling you should somehow retrieve the
position of the div in the dom and start the search for the span from
there, but i don't know if it's possible.
I hope this can set you on your way.
-- David
ronnie98 schreef:
Hi all,
i have troubles with subsequent siblings selection.
Provided the following code:
########################
..................
<span>foo</span>
<span>foo</span>
<div>first</div>
<span></span>
<span></span>
<span>first</span>
<span></span>
<span></span>
<div>second</div>
<span></span>
<span></span>
<span></span>
<span>second</span>
<span>foo</span>
<span>foo</span>
<span>foo</span>
<span>foo</span>
...................................
#######################
my goal is, for each "div", selecting the corresponding subsequent "span" so
that
first/first and second/second
So far i've come with this (not so much)
######################
$("div").each(function(i){
this......?????
});
#####################
thanks in advance,ronnie
--
David Duymelinck
________________
[EMAIL PROTECTED]