Bug Tracker

Ticket #6911: jquery-live-disabled.htm

File jquery-live-disabled.htm, 810 bytes (added by yoursunny, 11 years ago)

reproduce code

Line 
1<!DOCTYPE html>
2<html>
3<head>
4<title>ticket 6911</title>
5<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script>
6</head>
7<body>
8
9<p>Click on disabled [button1], no click event should fire. However, live click event fires in IE.</p>
10
11<div id="a">
12<input type="button" disabled="disabled" id="b1" value="button1">
13<input type="button" id="b2" value="button2">
14</div>
15
16<textarea id="log" rows="20" cols="100"></textarea>
17
18<script type="text/javascript">//<![CDATA[
19function log(m) { var t=$('#log');t.val(t.val()+'\n'+m); }
20$('#b1').click(function(){ log('click on #b1'); });
21$('#b2').click(function(){ log('click on #b2'); });
22$(':button','#a').live('click',function(){ log('live-click on #a :button'); });
23
24//]]></script>
25</body>
26</html>