Skip to content

Instantly share code, notes, and snippets.

@alvin-milton
Created November 30, 2018 16:16
Show Gist options
  • Save alvin-milton/118fbeaff0fea3f21cfdb98a6bee7f6b to your computer and use it in GitHub Desktop.
Save alvin-milton/118fbeaff0fea3f21cfdb98a6bee7f6b to your computer and use it in GitHub Desktop.
Checks to see if links have targets, what they are, if not what link has a missing target
$('a').each(function () {
if ($(this).attr('target')) {
console.log($(this).attr('target'))
console.log('target set', $(this).attr('href'))
} else {
console.log('no target set', $(this).attr('href'))
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment