I expected the code below to alert \"0\" and \"1\", but it alert \"2\" twice. I don\'t understand the reason. Don\'t know if it is a problem of jQuery. Also, please help me
It appears that you've created a closure inside your loop The Mozilla Developers Reference has a good section about this.