Monday, January 7, 2013

Simple Jquery each() Example


$(document).ready(function () {
   var arr = ["one", "two", "three", "four", "five"];
   jQuery.each(arr, function (index, value) {
   alert(value);
  });
});

Jquery each() is used to loop through a Jquery object. Above function will show alerts for each of the elements in the array.

No comments:
Write comments
Recommended Posts × +