What is the Use OF Each Function

Posted by Sabarimahesh under jQuery on 3/15/2012 | Points: 10 | Views : 1260 | Status : [Member] | Replies : 2
I can't Get it Exactly

Anybody Can Explain this Plz


http://api.jquery.com/jQuery.each/

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M



Responses

Posted by: Sheonarayan on: 3/15/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
jQuery.Each function is used to iterate through similar types of objects. It can be an array or html element of similar type.

$('p').each(function (index) { alert(index + ': ' + $(this).text()); });


Above code snippet will iterate through every paragraph of the page and alert its zero based index and its content(position in the page and its text).

Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Sabarimahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/16/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi Sheonarayan

Sure Man... It Is Very Useful......

Do You having Good Knowledge... in Jquery




Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Sabarimahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response