Bug Tracker

Modify

Ticket #9625 (closed enhancement: invalid)

Opened 2 years ago

Last modified 2 years ago

Support full range of allowed IDs in HTML5

Reported by: ssp Owned by:
Priority: high Milestone: 1.next
Component: selector Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

HTML5 seems to legalise all non-space characters for ID strings.

This creates a situation where you can have IDs which jQuery cannot match because its 'quickExpr' regular expression matches according to the more restrictive HTML4 standard.

See  http://jsfiddle.net/2Zpn4/4/ for an example showing that document.getElementByID can return elements which JQuery cannot match.

Change History

comment:1 Changed 2 years ago by rwaldron

  • Priority changed from undecided to high
  • Component changed from unfiled to selector

the /TR/ spec pages should not be used as reference as they are considered "trash" and exist only for record

The correct reference would be:

 http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#the-id-attribute

Last edited 2 years ago by rwaldron (previous) (diff)

comment:2 Changed 2 years ago by rwaldron

As a note, attribute selectors _do_ work here:

 http://jsfiddle.net/rwaldron/2Zpn4/8/

comment:3 Changed 2 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Just need to escape the special chars.

 http://jsfiddle.net/2Zpn4/6/

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.