Opened 8 years ago

Closed 5 years ago

#15580 closed defect (patchwelcome)

dojo.query not return correct results when custom attribute contains '=' or ','

Reported by: zhuxw Owned by: Kris Zyp
Priority: undecided Milestone: 1.13
Component: Query Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


Given a dom structure like this:

<div id='container'>

<div myattr="a=b">


</div> <div myattr="cd">




Then the following query should return the <div> containing 1:

dojo.query("[myattr='a=b'] div", "container"); return []

But it returns an empty array.

But if removing the root node "container", it works fine:

dojo.query("[myattr='a=b'] div"); correct

Same thing appears if myattr='a,b'.

Change History (2)

comment:1 Changed 8 years ago by Paul Christopher

It think = is not a valid character for ids/ class names, see

The relevant paragraph says:

"In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F"."

comment:2 Changed 5 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 3+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.