I am thinking of to add a javascript function to capture all the click events inside a html page.
So I am adding a global function that govern
Use event delegation:
document.addEventListener(`click`, e => { const origin = e.target.closest("a"); if (origin) { console.clear(); console.log(`You clicked ${origin.href}`); } });
some link some other (nested) link
[edit 2020/08/20] Modernized