Answers for "add link to javascript html"

10

how to create external link javascript

<script type="text/javascript" src="path-to-javascript-file.js"></script>
Posted by: Guest on March-08-2020
-1

create a link javascript

<html>
  <head></head>
  <body>
    <script>
      var a = document.createElement('a');
      var linkText = document.createTextNode("my title text");
      a.appendChild(linkText);
      a.title = "my title text";
      a.href = "http://example.com";
      document.body.appendChild(a);
    </script>
  </body>
</html>
Posted by: Guest on October-14-2020

Browse Popular Code Answers by Language