Take a link from a user to use as button link - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Button

Description

Take a link from a user to use as button link

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(){/*  w w  w . j a  v  a  2 s .c o m*/
var SiteURL = '';
SiteURL = 'http://java2s.com';
document.getElementById("a").href=SiteURL;
    }

      </script> 
   </head> 
   <body> 
      <a href="linkofuser" id="a" >test</a>  
   </body>
</html>

Related Tutorials