[jQuery] Exception to an event

[jQuery] Exception to an event

Here's the HTML:
<div class="registration">

Intro


<label>X:</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 input tag, so I tried adding
this:
$("div.registration input").unbind();
but that didn't work. It triggers the "parent event" if you see what I mean.
I also tried:
$("div.registration input").unbind("click");
but neither with success.
Anything obvious?
Alternatively, is there a suitable XPath expression I can use without
needing to unbind()?
--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/




























    • Topic Participants

    • peter