Created
April 15, 2014 10:31
-
-
Save djaoka/10721264 to your computer and use it in GitHub Desktop.
Breaking out of a PrototypeJS .each() loop
This file contains hidden or 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
$$('.myClass').each(function(oElement){ | |
if(oElement.getValue() == 'value'){ | |
//Do something | |
}else{ | |
//Leave the loop | |
throw $break; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment