1. <script type="text/javascript" data-cfasync="false">
  2. function download(){
  3. var text = document.getElementById("my-textarea").value;
  4. text = text.replace(/\n/g, "\r\n"); // To retain the Line breaks.
  5. var blob = new Blob([text], { type: "text/plain"});
  6. var anchor = document.createElement("a");
  7. anchor.download = "percent.txt";
  8. anchor.href = window.URL.createObjectURL(blob);
  9. anchor.target ="_blank";
  10. anchor.style.display = "none"; // just to be safe!
  11. document.body.appendChild(anchor);
  12. anchor.click();
  13. document.body.removeChild(anchor);
  14. }
  15. </script>
  16. <textarea id="my-textarea" style="vertical-align: top; position:relative; display: inline-block; width:15%; min-height:200px; background:none;">
  17. Notes here...
  18. </textarea>
  19. <button type="button" onclick="download()">Save</button>