Public Typewriter Test 2

by juberti

HTML

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <b>Typewriter Form Test Page</b>
    <form>
      <textarea id="note" name="note" rows="4" cols="80">Type something...</textarea>
      <audio class="akey" preload="auto" src="https://uniqcode.com/typewriter/assets/typewriter_sounds/typewriter-keydown-2.mp3"></audio>
    </form>
  </body>
  <script>
    var note = document.getElementById("note");
    note.onkeydown = function(e) {
      e.preventDefault();
      var xhr = new XMLHttpRequest();
      var fd = new FormData();
      fd.append("note", note.value);
      xhr.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
          thanks.style.display = "block";
        }
      }
      xhr.open("GET", "https://script.google.com/macros/s/AKfycbwZjs-cBpr_WeFxHoV08ePbzmnNbcYzW20kILGWB15ZVkcv99r-/exec", true);
      xhr.send();//fd);
    }
  </script>
</html>