I have ul tag inside div tag. I have applied mouseup event on div tag and click event on ul tag.
Issue
Whenever I click ul tag, then both mouseup and click events are triggered.
What I want is that when I click on ul tag, then only click event should trigger and if I do mouseup event on div tag, then only mouseup event should trigger.
My code:
HTML:
<div class="m1">
Nitin Solanki
<ul>
<li>one</li>
<li>two</li>
</ul>
</div>
JS:
$(document).on('mouseup', '.m1', function(){
alert('div mouseup ');
});
$(document).on('click', 'ul li', function(){
alert("ul li- clicked");
});