Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何转义诸如撇号之类的字符的内容?
以下 a:contains 在字符串文字上令人窒息
$('a:contains('\This'is choking on the apostrophe\')....
你可以试试这个:
$('a:contains("This isn\'t choking on the apostrophe")')
或这个:
$("a:contains('This isn\'t choking on the apostrophe')")