title: How to disable a submit button after one click?
body: <p>I have this form inside a div and the submit button inside another div. </p>
  
  <pre><code>&lt;div class="container1"&gt;
          &lt;form name="reg-form" id="signup" action="" method="post"&gt;      
              &lt;div class="sep"&gt;&lt;/div&gt;
              &lt;div class="inputs"&gt;
                  &lt;input type = "submit" id="submit" name="submitkey" value="GENERATE KEY" /&gt;
              &lt;/div&gt;
  
          &lt;/form&gt;         
      &lt;/div&gt;
  </code></pre>
  
  <p>How would I disable the submit button after one click? I tried every javascript code I find but it doesn't work on me. I dont know if it is because the form is inside a div and the submit button is inside another div. Thank you.</p>