This is my code:
$.each(3, function(n) { alert(n); });
I want to alert three times but it doesn\'t work. What can I do?
You can't. $.each can only iterate over arrays or objects. You're looking for the for loop:
$.each
for
for(var n = 0; n < 5; n++) { alert(n); }