Skip to content

Instantly share code, notes, and snippets.

@448jp
Created January 25, 2012 17:28
Show Gist options
  • Save 448jp/1677451 to your computer and use it in GitHub Desktop.
Save 448jp/1677451 to your computer and use it in GitHub Desktop.
jQueryで要素の有無を判定
if ($('selector').length) {
//要素がある場合の処理
} else {
//要素がない場合の処理
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment