Javascript examples for DOM Event:onclick
Handle Onclick event on different DIV tags
<html> <head></head> <body> <script type="text/javascript"> function manualToggle(val)/* w ww . j av a 2 s . c om*/ { console.log(val.id); } </script> <div id="test" onclick="manualToggle(this);"> <span>Allowed to click</span> <span onclick="event.cancelBubble=true;if (event.stopPropagation) event.stopPropagation();">Not allowed to click</span> <span>Allowed to click</span> </div> </body> </html>