0

Hi,

I have this markup:

<div onclick="dothis();">
 <span><img src="icon.png"></span>
 <span>Click here to do this</span>
 <span>some stuff</span>
 <span onclick="close();">X</span>
</div>

the problem is that when I click the X to execute close(); it also executes dothis() which I dont want. I know I could just put the on click on the span containing click here but the thing is that the image and the span below are suppose to execute the function too when clicked and putting an onclick on each one would be redundant. You might say also that I could just wrap the first 3 elements in a new div and put the function there but that would conflict with the function itself (I dont say why because I dont want to drag it out too long).

How can I solve this without having to change the markup?

Thank you.

Cain Nuke
  • 2,515
  • 4
  • 35
  • 55

0 Answers0