How do you stop .toggle() from toggling an object when a link (or any
object) inside the object is clicked.

Here's a quick contrived example:

<div id="toggle">
     Click here for more info
     <a onClick="DoSomething();">do something</a>
</div>
<div id="info">blah blah blah...</div>

<script>
$("#toggle").toggle(
     function () {
          $("#info").show();
     },
     function () {
          $("#info").hide();
     }
);
</script>

Clicking on the "toggle" <div> toggles the "info" <div>. If the "do
something" link is clicked, the "toggle" <div> will toggle *and*
DoSomething() will be called. I want to be able to click the "do
something" link and only have DoSomething() trigger but not cause the
<div> to toggle. Is this possible?

(Forgive the code if it's wrong, but I just whipped it up on the fly)

Reply via email to