Re: [jQuery] Exception to an event

2007-01-10 Thread Klaus Hartl
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

Re: [jQuery] Exception to an event

2007-01-10 Thread Peter Bengtsson
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!