How about using replaceChild - it will work in all browsers with NS6 / IE6 / Chrome1 / FX1 or so
Demo
Plain JS:
window.onload=function() { var anchors = document.getElementsByTagName('a'); for(var i=anchors.length-1;i>=0;i--){ var span = document.createElement("span"); span.innerHTML=anchors[i].innerHTML; anchors[i].parentNode.replaceChild(span,anchors[i]) span=null; } }
Or my first sentence in a comment on the page:
window.onload=function() { var anchors = document.getElementsByTagName('a'); for(var i=anchors.length-1;i>=0;i--){ anchors[i].onclick=function() { return false } } }
source share