Skip to content

Instantly share code, notes, and snippets.

@alfredbez
Last active August 29, 2015 14:01
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 alfredbez/bf4068bed430cf9f05f3 to your computer and use it in GitHub Desktop.
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
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