Has anyone ever had the experience where IE8 and IE9 won’t work with a jQuery selector where a special character is escaped?
This is the div I want to find:
<div id="hello|12345"></div>
And this is the jQuery selector I’m using to find it: $("div[id*='\\|']")
The result is that it doesn’t get found, and I have no idea why. It’s such a simple selector, and according to http://api.jquery.com/category/selectors/, using \\ is the proper way to escape the |. This of course works fine in Firefox and Chrome.
The two backslashes were actually unnecessary.