Array of selectors: for loop vs. $.each
Posted by: Jack Hard
Date: April 19, 2013 11:45PM

Given the following array of selectors (each of which are display: none in the our css) and for loop:

var arr = ['#home', '#news', '#tidy'];

for (i=0;i<=arr.length;i++){
$(arr).toggle();
}

What is an equivalent using $.each ( and presumably $(this) )?

Options: ReplyQuote


Subject
Views
Written By
Posted
Array of selectors: for loop vs. $.each
1672
April 19, 2013 11:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.