Bug Tracker

Modify

Ticket #6382 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

.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:
Blocking: Blocked by:

Description (last modified by jitter) (diff)

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>
<form>
    <input type="text" name="title" />
</form>

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

comment:1 Changed 3 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.

 http://yura.thinkweb2.com/domlint/

comment:2 Changed 3 years ago by dmethvin

  • Priority set to undecided
  • Status changed from new to open

comment:3 Changed 2 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 2 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 2 years ago by jitter

  • Priority changed from undecided to low
  • Status changed from open to closed
  • Resolution set to fixed
  • Description modified (diff)
  • Milestone set to 1.4.3

Closing as requested by the reporter. Fixed in 1.4.3

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.