function disable( link ) { var span = document.createElement("SPAN"); span.innerHTML = link.innerHTML; link.style.display = "none"; link.parentNode.insertBefore(span, link.nextSibling); }
<a href="ya.ru">link</a> <script type="text/javascript"> window.onload = function(){ document.getElementsByTagName('a')[0].href="#"; }; </script>