I have used two div and defined click event for their inner element using delegate in jquery 1.7.2. first click event is working fine as expected and second is not working.
$("#first").delegate(".ask div:first","click",function(e){
alert("hi");
});
$("#second").delegate(".ask div:first","click",function(e){
alert("hello");
});
Html markup:
<div id="first" >
<div class="ask">
<div> hi </div>
<div> disabled </div>
</div>
</div>
<div id="second" >
<div class="ask">
<div> hello </div>
<div> disabled </div>
</div>
http://jsfiddle.net/YjK3N/3/ But in jquery lower version the above code is working fine as expected.
I have tried it and you are right, it's not working. This code worked though: