Last active
August 29, 2015 14:01
-
-
Save alfredbez/bf4068bed430cf9f05f3 to your computer and use it in GitHub Desktop.
Prüft Bilder auf nicht vorhandene und leere ALT-Tags und Links auf nicht vorhandene und leere TITLE-Tags
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
var bilderOhneAltTag = jQuery('img:not([alt])'), | |
bilderMitLeeremAltTag = jQuery('img[alt=""]'), | |
linksOhneTitleTag = jQuery('a:not([title])'), | |
linksMitLeeremTitleTag = jQuery('a[title=""]'); | |
console.log('Bilder ohne alt-Tag: ' + bilderOhneAltTag.length); | |
if(bilderOhneAltTag.length > 0){ | |
console.log(bilderOhneAltTag); | |
} | |
console.log('Bilder mit leerem alt-Tag: ' + bilderMitLeeremAltTag.length); | |
if(bilderMitLeeremAltTag.length > 0){ | |
console.log(bilderMitLeeremAltTag); | |
} | |
console.log('Links ohne title-Tag: ' + linksOhneTitleTag.length); | |
if(linksOhneTitleTag.length > 0){ | |
console.log(linksOhneTitleTag); | |
} | |
console.log('Links mit leerem title-Tag: ' + linksMitLeeremTitleTag.length); | |
if(linksMitLeeremTitleTag.length > 0){ | |
console.log(linksMitLeeremTitleTag); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment