SyntaxFix
Write A Post
Hire A Developer
Questions
Use jQuery each(). There are other ways but each is designed for this purpose.
each()
$.each(substr, function(index, value) { alert(value); });
And do not put the comma after the last number.