Bug Tracker

Opened 10 years ago

Closed 10 years ago

#12701 closed bug (notabug)

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:


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

Change History (2)

comment:1 Changed 10 years ago by Christian Meixner <[email protected]…>

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

See jQuery documentation on how to escape meta-chars in selectors: http://api.jquery.com/category/selectors/

comment:2 Changed 10 years ago by gibson042

Component: unfiledselector
Resolution: notabug
Status: newclosed
Note: See TracTickets for help on using tickets.