I have a link: <a href="/somelink" id="link_test" onclick="return func(event);">Link</a>.
I want to remove this onclick attribute and add a click event listener by addEventListener.
I tried:
ge("link_test").addEventListener('click',function(){
return func(window.event);
},false);
also:
ge("link_test").addEventListener('click',"return func(window.event);",false);
No result. Is it possible to do it by addEventListener (and how)?
PS: actually I have a cross-browser variant of addEventListener func, but not important in this case.
Try:
Do you mean something like this