views:

18

answers:

1

Hi guys, I have the following structure :

<li onclick='GetMyTopic({1});' class='SideBarBoxli SideBarBoxLiSelected' id='MyTopics{0}'>

<div style='float:right; padding-top:3px;'><a href='{0}'> <span>{1}</span></a></div>

<div > <a  id='img{2}'  onclick='DeleteTopic({0},{1})' href='#'> <img  src='../../../images/delete.png' height='16' width='16'/></a></div>

</li>

When I click the img Delete of the first span, the li click is also invoked.

I just want when I click delete img the delete img script only gets invoked and not the li. same for the span element.

Thanks.

A: 

In that case, add a return false, e.g.:

DeleteTopic({0},{1}); return false;

This will stop the click event from bubbling up to the <li> element, triggering its handler as well.

Nick Craver
This will only stop page PostBack. The li is still clicked though
Joseph Ghassan