Skip to content

Instantly share code, notes, and snippets.

@alvin-milton
Created November 30, 2018 16:16
Show Gist options
  • Select an option

  • Save alvin-milton/118fbeaff0fea3f21cfdb98a6bee7f6b to your computer and use it in GitHub Desktop.

Select an option

Save alvin-milton/118fbeaff0fea3f21cfdb98a6bee7f6b to your computer and use it in GitHub Desktop.

Revisions

  1. alvin-milton created this gist Nov 30, 2018.
    8 changes: 8 additions & 0 deletions linktargetcheck.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    $('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'))
    }
    })