I am using jQuery for a list and a div element click. HTML code is-
<ul class="list-group">
<li class="list-group-item">
<div>
<div>
Anything <img id="image_click" src="http://www.neatimage.com/im/lin_logo.gif">
</div>
<div>
More thing
</div>
</div>
</li>
<li class="list-group-item">Documents</li>
<li class="list-group-item">Music</li>
<li class="list-group-item">Videos</li>
</ul>
And jQuery code is-
$( document ).ready(function()
{
$(".list-group-item").click(function()
{
alert($("For list");
});
$("#image_click").click(function()
{
alert("for image");
});
});
When I click on a li item, only For list is alerted. But if I clicked on image, then for image and after that For list is alerted.
What I want is if anyone click on li element, For list should be alerted, but if he clicks on the image, only for image should be alerted, for list should not be alerted.