I\'ve added a button inside a link tag, with a little cross image, that I will eventually use to actually remove that element without it following the link also:
<
First change your function to:
function detectClick(message){
window.alert("Detected: " + message);
return false; // add this line
}
then change the onclick
handler to:
onclick="return detectClick('Google')" // note the "return"
Please do note that AFAIK the HTML standard does not allow to have a button inside an anchor.