title: Saving URL path in the text file by using JavaScript
body: <p>I would like to save/export my URL address to the text file (.txt).</p>
  <p>Firstly I've managed with copying my URL address to the <code>&lt;textarea&gt;</code> by following this query:</p>
  <p><a href="https://stackoverflow.com/questions/40958613/how-to-copy-url-on-button-click">How to copy URL on button click?</a></p>
  <p>It works perfectly for me, although I need a bit more here. I need to have it exported to the text file.
  Because I work on a local server, I use the get method in my form. It results in quite a long URL, which can be retrieved (reopened) when copied. I think it could be convenient for me to have it stored somewhere, like in the <code>.txt</code> file.</p>
  <p>I used this solution:</p>
  <p><a href="https://www.websparrow.org/web/how-to-create-and-save-text-file-in-javascript" rel="nofollow noreferrer">https://www.websparrow.org/web/how-to-create-and-save-text-file-in-javascript</a></p>
  <p>for saving dynamic data, although it doesn't work for me.</p>
  <p>My code looks like this now:</p>
  <pre><code>        &lt;script&gt;
              function Copy() {
          var Url = document.getElementById(&quot;url&quot;);
          Url.innerHTML = window.location.href;
          console.log(Url.innerHTML)
          Url.select();
          document.execCommand(&quot;copy&quot;);
          }  
  
          function saveStaticDataToFie() {
              var Urltext = document.getElementById(&quot;url&quot;).value;
  
              var blob = new Blob([Urltext], {type: &quot;text/plain;charset=utf-8&quot;})
              saveAs(blob, &quot;survey.txt&quot;);
          }
         &lt;/script&gt;
  
         &lt;button type=&quot;button&quot; onclick=&quot;saveStaticDataToFile();&quot;&gt;Click to Save&lt;/button&gt;
  </code></pre>
  <p>I see no reaction at all. What have I done wrong here?</p>