Skip to content

Instantly share code, notes, and snippets.

@binaryreverse
Last active June 13, 2016 12:34
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 binaryreverse/b7ba9470257d46d8dce97e8e3d1bccd4 to your computer and use it in GitHub Desktop.
Save binaryreverse/b7ba9470257d46d8dce97e8e3d1bccd4 to your computer and use it in GitHub Desktop.
Check each element in a nested structure (like a slider) for a specific data attribute and mark these elements visually witha red background (Q&D)
$('.my-outer-container').find('.my-element').each(function() {
if(typeof $(this).data('my-datakey') === 'undefined') {
$(this).css('background', '#FF0000');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment