Created
January 23, 2014 14:43
-
-
Save Huskie/8579597 to your computer and use it in GitHub Desktop.
A standard for loop given a variable named 'elements', which contains a Node List of HTML elements, likely returned from a 'document.querySelectorAll' statement.
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
// Given a variable 'elements', which contains a Node List of HTML elements | |
for ( var i = 0; i < elements.length; i++ ) { | |
var self = elements[i]; | |
// Do stuff with element | |
self.doStuff(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment