I've got <span id="/about-us">
being generated by this CMS I'm using.
I'd like to select this element with jQuery but it doesn't seem to like selecting elements with a slash in them.
Is this possible?
I've got <span id="/about-us">
being generated by this CMS I'm using.
I'd like to select this element with jQuery but it doesn't seem to like selecting elements with a slash in them.
Is this possible?
you can do
$("#\\/about-us")
you can do it like this
$("span[id*='/about-us']")
where it will return the span with '/about-us' in it's id attribute.
Use the regular way:
document.getElementById('id/with/slashes')
see
Regex Selector for jQuery
or related question