title: How do you disable a button using an onclick javascript function?
body: <p>I need to remove button click event after press.
  How can I edit the function so whenever it's clicked, it gets disabled then runs the url, or vise-versa.</p>
  
  <pre><code>&lt;form id="edit" action="" method="post"&gt;
      &lt;input type="submit" name="button" onclick="this.value='test...'; MyFunction();" id="1" class="button blue" value="Submit"&gt;
  &lt;/form&gt;
  &lt;script&gt;
      function MyFunction() {
          var url = "editing.php";
          document.getElementById("edit").setAttribute('action', url);
          return false;
      }
      $(".blue").click(function(){
          $(".blue").removeClass("disabled");
          $(this).addClass("disabled");
      });
  &lt;/script&gt;
  </code></pre>