Last active
August 29, 2015 14:09
-
-
Save zjhiphop/d06d8d42b4d5e19c0232 to your computer and use it in GitHub Desktop.
jquery-each-context issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test() { | |
var a = 1; | |
$('span').each(function() { | |
this.innerHTML = a; // 'a' can not accessed in this scope | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment