title: Clicking HTML Button and Create a File
body: <p>Can someone helps me, i need to make a button when it Clicked, will creating a file in my storage</p>
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    
  &lt;body style=&quot;text-align:center;&quot;&gt;
      &lt;h1 style=&quot;color:green;&quot;&gt;  
              Create Your First Account 
      &lt;/h1&gt;
      Name:&lt;input type=&quot;text&quot; id=&quot;username&quot; value=&quot;Jack&quot;&gt;
      &lt;p&gt;
          Password:&lt;input type=&quot;password&quot; id=&quot;password&quot; value=&quot;some password&quot;&gt;
      &lt;/p&gt;
      &lt;p&gt;
      &lt;button type=&quot;button&quot; onclick=&quot;createNow()&quot;&gt;Create Your First Account&lt;/button&gt;
      &lt;/p&gt;
      &lt;p href=&quot;admin_mode.html&quot;&gt;
        &lt;button&gt;Admin Mode&lt;/button&gt;
      &lt;/p&gt;
  
      &lt;script&gt;
      var fs = require('fs')
      function createNow() {
          var userinput = document.getElementById(&quot;username&quot;).value;
          var passwordinput = document.getElementById(&quot;password&quot;).value;
          var content = `{ &quot;username&quot;: &quot;${userinput}, &quot;password&quot;: &quot;${passwordinput} &quot;}`
         //Create user acc
          fs.writeFileSync(`./database/registeredUser/${userinput}.json`, content)
          &lt;a href=&quot;home.html&quot;&gt;
      }
      &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>i've put a <code>fs.writeFileSync</code> there and when someone click the button, its not creating the file and contents</p>