<a href="ya.ru">link</a> <script type="text/javascript"> window.onload = function(){ document.getElementsByTagName('a')[0].href="#"; }; </script>