Hide link in html - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Anchor

Description

Hide link in html

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
window.onload = function() {/*from   w ww . j av a  2 s .  c o m*/
    for(var i = 0; i < document.links.length; i++) {
        document.links[i].onclick = function() {
            return false;
        }
    }
};

      </script> 
   </head> 
   <body> 
      <a href="http://www.example.com">abc</a> 
      <a href="http://www.java2s.com">java2s</a>  
   </body>
</html>

Related Tutorials