Reputation: 29
I Have a <div>
Element, which includes a Button.
Both have Events. Code for the Button:
<button Title="Auswahl anzeigen" class="PopUpButton2" onClick="findArticlesFromSearchBoxButton()">OK</button>');
Code for the Div-Element:
<div draggable="true" Title="aus aatentechnichen Gründen können beide Suchmethoden noch nicht miteinander kombiniert werden!" onMouseDown="dragStart(this);" id="divArtikelart">
When I click to the button also the clicks on die div-Elements are executed. How can i avoid this?
Upvotes: 3
Views: 292
Reputation: 347
$("button").click(function(event){
event.stopPropagation();
});
Add stopPropogation at first line in your button click function. this should resolve issue
Upvotes: 3