Javascript code:
clearOutput(); A.addEventListener("click", function(event) { print("click A"); }, false // false=bubbling, true=capturing ) print("Ready");
Run
Output: