Peter Bengtsson schrieb:
Here's the HTML:
div class=registration
pIntro/p
labelX:/label
input name=foo /
/div
Here's the jQuery code:
$(div.registration).click(function() {
alert(clicked anywhere in registration div)
});
But I don't want this event to apply to the
Alternatively, is there a suitable XPath expression I can use without
needing to unbind()?
Try:
$(div.registration).click(function(e) {
if (e.target.tagName.toLowerCase() != 'input') {
alert(clicked anywhere in registration div except for input)
}
});
Thanks!