6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【jQuery】引用符とエスケープを覚える

Posted at

#内側と外側同じ引用符を使って、内側をエスケープ(\)する

$('a[href=\'http://qiita.com\']') //シングルクオート(')とエスケープ(\)
$("a[href=\"http://qiita.com\"]") //ダブルクオート(")とエスケープ(\)

#内側と外側で別の引用符を使う

$('a[href="http://qiita.com"]') //外側はシングルクオート(')で内側はダブルクオート(")
$("a[href='http://qiita.com']") //外側はダブルクオート(")で内側はシングルクオート(')

こっちのほうが簡単だと思うけど、どうなんだろう・・・

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?