Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#6881 closed bug (invalid)

Some valid selectors throw a syntax error when passed to jQuery.fn.is()

Reported by: elijahr Owned by:
Priority: Milestone: 1.4.3
Component: traversing Version: 1.4.2
Keywords: focus, is, Cc:
Blocked by: Blocking:

Description (last modified by dmethvin)

var input; input = $('input').eq(0); try {

input.is(':focus');

} catch(e) { /* "Syntax error, unrecognized expression: Syntax error, unrecognized expression: focus" */ }

try {

input.is(':hover');

} catch(e) { /* "Syntax error, unrecognized expression: Syntax error, unrecognized expression: hover" */ }

Change History (2)

comment:1 Changed 13 years ago by dmethvin

Description: modified (diff)
Resolution: invalid
Status: newclosed

Neither :focus nor :hover are supported selectors in jQuery. The complete list of supported selectors is here:

http://api.jquery.com/category/selectors/

comment:2 Changed 13 years ago by anonymous

It's working using jQuery('foo:hover'), so I wonder whether it's supported or not.

Note: See TracTickets for help on using tickets.