Hide link by setting href via Javascript - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Anchor

Description

Hide link by setting href via Javascript

Demo Code

ResultView the demo in separate window

<!doctype html>
<html>
   <head> 
      <title>Bla!</title> 
      <script type="text/javascript">
            function SetDest(a) {
                a.href = "http://java2s.com";
            }/*  w ww  .ja v  a 2s.c om*/
        
      </script> 
   </head> 
   <body> 
      <a href="" onclick="SetDest(this);"> Click Here </a>  
   </body>
</html>

Related Tutorials