?
Solved

need to create an iterator function in jQuery

Posted on 2011-09-29
3
Medium Priority
?
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 1000 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 1000 total points
ID: 36868483
$(this).find( "ul ") .each(function(){
 alert($(this).html());
});
0
 

Author Closing Comment

by:newbieweb
ID: 36895524
Thanks!
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

770 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