Created
May 16, 2016 14:46
-
-
Save alenabdula/714d63b16deb5029841027ddb42e767c to your computer and use it in GitHub Desktop.
Collection of random jQuery stuff!
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
/** | |
* Display all images without ALT tag | |
*/ | |
var images = jQuery('img'); | |
images.each(function(index, value) { | |
var el = jQuery(this); | |
var attr = el.attr('alt'); | |
if ( typeof attr !== typeof undefined && attr !== false ) { | |
if ( attr === '' ) { | |
console.log(value); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment