stop internal div from firing event associated with external div
Hi,
if I have a button within a div, how do I stop the internal button clicks from also triggering the click event on the surrounding div?
Here's the div and button:
- <div id="externalDiv" class="ui-li ui-li-static ui-btn-up-c">
- <h1>When the user clicks the button, I do not want the external click event to fire</h1>
- <div>
- <a href="#" data-role="button" id="internalButton">Internal Button</a>
- </div>
- </div>
and here are the events:
- $('#externalDiv').click(function () {
- alert('external div clicked');
- });
- $('#internalButton').click(function () {
- alert('internal button clicked');
- });
thanks
Matt