Solved

need to create an iterator function in jQuery

Posted on 2011-09-29
3
197 Views
Last Modified: 2012-06-27
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.
0
Comment
Question by:newbieweb
3 Comments
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 250 total points
ID: 36851411
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
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 250 total points
ID: 36868483
$(this).find( "ul ") .each(function(){
 alert($(this).html());
});
0
 

Author Closing Comment

by:newbieweb
ID: 36895524
Thanks!
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question