Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#861 closed bug (fixed)

Regression in 1.1.1: search with context finds parent, not the desired element

Reported by: [email protected] Owned by:
Priority: major Milestone:
Component: core Version: 1.1
Keywords: Cc:
Blocked by: Blocking:

Description

Consider the following snippet:

<ul id="nav">
    <li>...</li>
</ul>
$('<li><a href="#">Change location</a></li>').prependTo('#nav').find('a').bind('click', function() {
    var close = $('span', this); // same with $(this).find('span');
    console.log( close[0]); // it's the <a> and not a <span> element
    return false;
});

The query $('span', this) returns the parent element if there's no match.

Change History (2)

comment:1 Changed 16 years ago by joern

Resolution: fixed
Status: newclosed

Fixed in revision 1172.

comment:2 Changed 16 years ago by [email protected]

I tried revision 1172 and got: $(document).ready is not a function error. Do I miss something?

Note: See TracTickets for help on using tickets.