iterating over jQuery objects
$.each
accepts 2 parameters: the array to iterate over and an anonymous function
var namesArray = ['bob', 'mary', 'alex'];
$.each(namesArray, function(index, name) {
//code
})
$().each
is different because this iteration works only on jQuery objects!!$('#div_name').each(function(index, element) {
//code
});