Side navigation
#12701 closed bug (notabug)
Opened October 11, 2012 08:43AM UTC
Closed October 11, 2012 12:21PM UTC
Cannot use arbitrary characters in id selectors for html5
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | selector | Version: | git |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi there,
I've noticed that code like this doesn't work:
$('<div id="foo~edit">').is('#foo\\~edit')
Even though the html5 spec allows such ids and specifies for them to be escaped with \\ where appropriate.
Regards,
Martin
Works:
http://jsfiddle.net/t6C5h/1/
See jQuery documentation on how to escape meta-chars in selectors:
http://api.jquery.com/category/selectors/