I have a div, and that div has an onclick event. Inside of the div, there is some text, and a button. When I click on the text, the div onclick is sent, which is good. Howev
Use stopPropagation event function. This way divClick function will not be called.
divClick
function buttonClick(e) { if (!e) e = window.event; e.stopPropagation(); // do what you want }
Because of Firefox you need to explicitly send event as argument like this:
event
Click Me
Demo