Skip to content

Instantly share code, notes, and snippets.

@yajamon
Created July 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yajamon/169d9b216ac715b8e8f3 to your computer and use it in GitHub Desktop.
Save yajamon/169d9b216ac715b8e8f3 to your computer and use it in GitHub Desktop.
$( "div" ).each(function( index, element ) {
// element == this
$( element ).css( "backgroundColor", "yellow" );
if ( $( this ).is( "#stop" ) ) {
$( "span" ).text( "Stopped at div index #" + index );
return false; // break each.
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment