Skip to main content

Bug Tracker

Side navigation

#6911 closed bug (fixed)

Opened August 17, 2010 04:03AM UTC

Closed February 18, 2011 06:37PM UTC

Last modified March 19, 2012 09:15PM UTC

.live('click',handler) should not fire on disabled button in IE

Reported by: yoursunny Owned by: danheberden
Priority: high Milestone: 1.5.1
Component: event Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Take the following snippet:

<div id="a">

<input type="button" disabled="disabled" id="b1" value="button1">


$(':button','#a').live('click',function(){ });

The live click event does not fire in Firefox 3.6, but fires in IE8 on Win7.

Since the button is disabled, I think the correct implementation should not fire live click event on #b1.

Attachments (1)
Change History (27)

Changed October 15, 2010 04:34AM UTC by snover comment:1

priority: → high
status: newopen

Changed October 21, 2010 10:59PM UTC by snover comment:2


Retargeting due to severity of regressions in 1.4.3.

Changed October 22, 2010 05:53AM UTC by snover comment:3


Retargeting for 1.4.4 as per John’s request.

Changed October 22, 2010 06:27AM UTC by snover comment:4

owner: → danheberden
status: openassigned

Changed October 25, 2010 09:19PM UTC by anonymous comment:5

Submitted pull request to disable events on disabled items:

Changed October 25, 2010 09:34PM UTC by danheberden comment:6

Heh, guess it helps to log in before doing that :p Pull req:

Changed October 28, 2010 02:09AM UTC by snover comment:7


Retargeting to next minor release.

Changed November 20, 2010 03:29PM UTC by dmethvin comment:8

Changed November 21, 2010 11:15PM UTC by danheberden comment:9

resolution: fixed
status: closedreopened

Changed November 21, 2010 11:16PM UTC by danheberden comment:10

That commit was backed out - I will provide a new one.

Changed November 22, 2010 12:59AM UTC by danheberden comment:11

Changed November 22, 2010 07:12AM UTC by snover comment:12

status: reopenedassigned

Changed December 06, 2010 09:39PM UTC by john comment:13

resolution: → fixed
status: assignedclosed


Changed January 14, 2011 10:20PM UTC by jitter comment:14


Move fixed tickets to appropriate milestone

Changed February 02, 2011 05:52PM UTC by comment:15

Is this correct? It seems to me the fix should be to check currentTarget, not target.

Also, it's not limited to IE - it can be reproduced on Chrome 9.0.597.45. See

Changed February 02, 2011 06:04PM UTC by danheberden comment:16 - take it for a spin :)

Changed February 03, 2011 04:12PM UTC by ms7821 comment:17

danheberden: thanks. I think this might really be a separate bug, which is half fixed by your commit.

It's possible to receive events for a disabled <button> element as well as <input type="button">: (jQuery 1.4.4) (jQuery 1.5)

IE7 fires click for all of them, passing the button as the target and currentTarget.

Chrome fires only for the <button> with a child element, passing that as the target. However, currentTarget is set to the button, so changing target.disabled to currentTarget.disabled should extend the fix to include Chrome.

I didn't realise 1.5 had already been released, so I'll open a new ticket specifically for buttons on Chrome.


Changed February 03, 2011 04:17PM UTC by danheberden comment:18

resolution: fixed
status: closedreopened

Well in the end it's the same root issue, i'll go a head and re-open this one. Thanks for your work!

Changed February 03, 2011 04:18PM UTC by ms7821 comment:19

Ahh, do you want me to delete

Changed February 03, 2011 04:19PM UTC by danheberden comment:20

#8165 is a duplicate of this ticket.

Changed February 03, 2011 04:20PM UTC by danheberden comment:21

Marked as dup - that'll link them together :)

Changed February 06, 2011 04:09PM UTC by snover comment:22

status: reopenedopen

Changed February 18, 2011 05:37PM UTC by danheberden comment:23

_comment0: While at first glance "currentTarget" sounds like a reasonable fix, it isn't. \ \ The firing event is still the element that is NOT disabled. So this fix would involve checking every click events parents for an element that's disabled. That isn't reasonable, as you can imagine. \ \ So while we can easily check if, checking the parent just in case isn't as easy. I mean easy as in not penalizing non-disabled actions with a crap load of work. \ \ In this context, if you plan on attaching to elements that might be children of disabled elements then by all means, place that check in your own code. \ 1298051052427514
resolution: → fixed
status: openclosed

actually, just might got it fixed

Changed February 18, 2011 05:44PM UTC by danheberden comment:24

resolution: fixed
status: closedreopened

Changed February 18, 2011 06:15PM UTC by danheberden comment:25

DaveMethvin pummeled me until i saw a way to do it - all better in

Changed February 18, 2011 06:37PM UTC by john comment:26

resolution: → fixed
status: reopenedclosed


Changed February 25, 2011 10:08AM UTC by ms7821 comment:27

Awesome to see, thanks danheberden!