Why does this jQuery varibale read as undefined within a each loop?
This should be really simple and i do feel daft for asking this BUT for some reason the following code alerts as undefined. Why?
- myCount = 1;
- jQuery("div").each(function() {
- alert(myCount);
- });