Reputation: 13347
How can I escape content for characters such as an apostrophe ?
The following a:contains is choking on the string literal
$('a:contains('\This'is choking on the apostrophe\')....
Upvotes: 2
Views: 106
Reputation: 145368
You can try this:
$('a:contains("This isn\'t choking on the apostrophe")')
Or this:
$("a:contains('This isn\'t choking on the apostrophe')")
Upvotes: 14