Skip to main content

Bug Tracker

Side navigation

#11433 closed bug (invalid)

Opened March 04, 2012 12:08PM UTC

Closed March 04, 2012 12:51PM UTC

Selecting by class and attribute without tag name

Reported by: andrius@palivonas.lt Owned by:
Priority: low Milestone: None
Component: selector Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

This

$('td.points[data-points=11.5]')

works fine. This doesn't

$('.points[data-points=11.5]')
Error: Syntax error, unrecognized expression: [data-points=11.5]

tried in page and in Chrome console. Why would it be necessary to provide tag name? I believe this is a bug.

http://jsfiddle.net/4D5HL/12/

Attachments (0)
Change History (1)

Changed March 04, 2012 12:51PM UTC by sindresorhus comment:1

component: unfiledselector
priority: undecidedlow
resolution: → invalid
status: newclosed

From the attribute selector docs:

An attribute value. Can be either an unquoted single word or a quoted string.

You either need to quote it or escape the dot in the attribute value.

Example: [data-points="11.5"] or [data-points=11\\.5]

The former is preferred.