Skip to main content

Bug Tracker

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')

http://jsfiddle.net/t6C5h/

Even though the html5 spec allows such ids and specifies for them to be escaped with \\ where appropriate.

Regards,

Martin

Attachments (0)
Change History (2)

Changed October 11, 2012 09:48AM UTC by Christian Meixner <christian.meixner@bippesbrandao.de> comment:1

Works:

http://jsfiddle.net/t6C5h/1/

See jQuery documentation on how to escape meta-chars in selectors:

http://api.jquery.com/category/selectors/

Changed October 11, 2012 12:21PM UTC by gibson042 comment:2

component: unfiledselector
resolution: → notabug
status: newclosed