Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <title>HTML JavaScript output on same page</title>
    <script type="text/JavaScript">
      function showMessage(){
        var navn = document.getElementById("navn").value;
        display_navn.innerHTML= navn;
        var mail = document.getElementById("mail").value;
        display_mail.innerHTML= mail;
        display_mail.parentNode.setAttribute("href", "mailto:" + mail);
        var tlf = document.getElementById("tlf").value;
        display_tlf.innerHTML= tlf;
      }
    </script>
  </head>
  <body>
    <form>
      Navn: <br>
      <input type="text" id = "navn"><br>
      E-post: <br>
      <input type="text" id = "mail"><br>
      Mobil: <br>
      <input type="text" id = "tlf"><br>
      <br>
      <br>
      <input type="button" onclick="showMessage()" value="submit" />
    </form>
    <br>
    <br>
    <span id = "display_navn"></span><br>
    <br>
    <a href="mailto:"><span id = "display_mail"></a></span><br>
    <br>
    <span id = "display_tlf"></span>
  </body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers