need to create an iterator function in jQuery

This works:

$( $( this ).siblings( "ul ") [0].innerHTML).show();

But I need to test each element mefore adding it to resulting the selector.

What syntax can I use to create a function?

Thanks.
newbiewebSr. Software EngineerAsked:
Who is Participating?
 
Kiran SonawaneConnect With a Mentor Project LeadCommented:
$(this).find( "ul ") .each(function(){
 alert($(this).html());
});
0
 
Gurvinder Pal SinghConnect With a Mentor Commented:
use http://api.jquery.com/each/
$( this ).siblings( "ul ") .each(function(){
  //here you can write custom code after check whatever you want to check
});
0
 
newbiewebSr. Software EngineerAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.