Ticket #3729 (closed bug: fixed)
Attribute selector with an class seperator(':') in it, fails.
| Reported by: | Dykam | Owned by: | jitter |
|---|---|---|---|
| Priority: | high | Milestone: | 1.5 |
| Component: | selector | Version: | 1.5rc1 |
| Keywords: | attribute selector class | Cc: | |
| Blocking: | Blocked by: |
Description
This code fails: $('[xml:lang="nl"]'); While this works: $('[id="someID"]');
I needed this because when validating the html attribute lang="", the validator tells me I need xml:lang="".
Change History
comment:2 Changed 4 years ago by balazs.endresz
In 1.3.0 when escaping the colon the backslash isn't removed from match[1]. Looks like the same as #3803.
comment:3 Changed 4 years ago by john
- Owner set to john
- Version changed from 1.2.6 to 1.3
- Milestone changed from 1.3 to 1.3.1
Ok, I'll check in to it.
comment:4 Changed 4 years ago by john
- Status changed from new to closed
- Resolution set to fixed
Ok, should be fixed now. http://github.com/jeresig/sizzle/commit/380f65bfa72febab01effc0414b0c052f63a2a25
Will be merging into jQuery shortly.
comment:5 Changed 4 years ago by larholm
- Status changed from closed to reopened
- Resolution fixed deleted
jQuery 1.3.1 - I am still unable to use a selector for attributes with : in their name, such as in namespaced attributes.
Here is a simple testcase:
<a href="somewhere.html" test:ajax="json">test</a>
$('a[test
:ajax]')
No elements matched.
comment:6 Changed 4 years ago by michaelmaw
I am using jQuery 1.3.2 and this works fine in Firefox, but fails in IE (tested using IE 7).
Example: <div my:tooltip="Show this"></div>
jQuery: $('div[my
:tooltip]')
IE error: "Object doesn't support this property or method"
comment:7 Changed 4 years ago by balazs.endresz
I've had a quick look at it and it seems like the ATTR prefilter removes the backslash but it appears again in filter.ATTR! Moreover, if you call $('div[my\\:tooltip]') instead of $('div[my\\:tooltip="Show this"]') then filter.ATTR isn't even called, is that OK?
comment:8 Changed 3 years ago by snover
- Status changed from reopened to pending
This ticket has been marked as missing a test case. In an effort to reduce the number of outstanding tickets in the bug tracker, it will be closed automatically in 30 days. In order to prevent this from happening, please provide a working test case. If a test case has already been provided and our records are wrong, please respond to the ticket so that it can be fixed. Thank you!
comment:9 Changed 3 years ago by trac-o-bot
- Status changed from pending to closed
Automatically closed due to 14 days of inactivity.
comment:10 Changed 2 years ago by jitter
- Priority changed from major to high
- Status changed from closed to reopened
- Version changed from 1.3 to 1.5rc1
- Milestone changed from 1.3.1 to 1.5
comment:11 Changed 2 years ago by jitter
- Owner changed from john to jitter
- Status changed from reopened to assigned
comment:12 Changed 2 years ago by Anton M
- Status changed from assigned to closed
- Resolution set to fixed
Pull over tests from Sizzle. Fixes #3729. Fixes #6428.
Changeset: 1e4f3c07c70861fc334a0e61080f8bbde0d7d442
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Did you try escaping the colon?
http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F