I have below HTML code.
<li class="list-group-item font-weight-bold">
Mouse
<img src="images/delete.png" class="delete"/>
</li>
I have 2 different jQuery .click()
method. One for the <li></li>
and another for <img/>
.
Now when I click on <img/>
, then <li></li>
.click()
method also running.
Here is the jQuery code.
$('.list-group li').click(function () {
//some code here
});
$('.delete').click(function () {
//some code here
});
How can I keep them separate, so that each .click()
method run individually ?