Bug Tracker

Opened 14 years ago

Closed 13 years ago

#6382 closed bug (fixed)

.live() not working properly with "has attribute" css selector

Reported by: cjoudrey Owned by:
Priority: low Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by jitter)

There appears to be a problem with .live() and "has attribute" css selector when using forms.

Using the following HTML:

<span title="test">1234</span>
    <input type="text" name="title" />

When you run $('[title]'), the span element is returned.

However, if you use the following:

$('[title]').live('click', function() {
    alert('clicked a [title]');

When you click on the input an alert occurs. The selector [title] returns the <form>.

Reproduced in Firefox 3.6.

Change History (5)

comment:1 Changed 14 years ago by dmethvin

This is actually due to the fact that the names of input elements become properties of the form that contains them.


comment:2 Changed 13 years ago by dmethvin

Priority: undecided
Status: newopen

comment:3 Changed 13 years ago by anonymous

I think I'm understanding the question correctly, but was not able to replicate the problem here: http://jsfiddle.net/dBsr4/

Clicking on the second input does not return the 'item clicked' alert.

comment:4 Changed 13 years ago by cjoudrey

I am also unable to replicate the problem now. Maybe it got fixed. The issue can be closed.

comment:5 Changed 13 years ago by jitter

Description: modified (diff)
Milestone: 1.4.3
Priority: undecidedlow
Resolution: fixed
Status: openclosed

Closing as requested by the reporter. Fixed in 1.4.3

Note: See TracTickets for help on using tickets.