repl.it
HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • doc.txt
  • script.js
  • style.css
  • test.txt
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
  </head>
<body>
  <input id='input'>
  <button id='save' onclick='save();'>Save text</button>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js"></script>


    <script>
    function save(){
      echo file_exists('doc.txt')
      //$text = (document.getElementById('input').value);
    }
    </script>
</body>
</html>
result
console