Why is the slash character causing my selector to fail?

Viewed 211

Using JQuery 1.6.4 on IE 11

I have an element with a slash in its ID.

<span id='a/b'>
test
</span>

In my code, I am doing

alert($('#a/b').length);

Output is 0. This only occurs when I have a slash (/) in the ID. document.getElementById('a/b') is functioning correctly.

So I am confused as to why the id with the slash is not working in JQuery?

1 Answers
Related