I want to select all p elements in .section container, but just in the one that contains the a.open link that has been clicked
$('.section').delegate('a.open', "click", function(){
$(this).parent().filter('p').show(); //I want to select all `p` elements in .section container, but just in th one that containts the a.open link that has been clicked
})
Thanks
You could pass the delegateTarget as context (delegateTarget is a property of the event object which is passed to handler function and is the DOM element which "Handles" the delegation
$('.section').delegate('a.open', "click", function(e){
$('p', e.delegateTarget).show()
//This means show all <p> elements in the context defined by e.delegateTarget
})
look at this fiddle http://jsfiddle.net/jWYKv/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With