title: Change text of Input button after clicking on it
body: <p>I have the following input HTML tag</p>
  
  <pre><code>&lt;input type="submit" id="submitForm" value="Submit" class="btn btn-primary start" autocomplete="off" onclick="submitForm();" /&gt;
  </code></pre>
  
  <p>When I click on the submit button, it goes to the related JavaScript file and executes the function submitForm();</p>
  
  <p>I would like to change the text of the submit form to "Please wait..." until the function is completed.</p>
  
  <p>Is there a way this can be done?</p>
  
  <p>This is how the submitForm() function looks like:</p>
  
  <pre><code>function submitForm() {
          $("#submitForm").val("Please wait...");
          if (formValidation() === true) {
              submitFormInfo().done(function () {
                  $("#submitForm").val("Submit");
              });
          }
  }
  
  function submitFormInfo() {
  return $.ajax({
          cache: false,
          url: "URLHERE"
          error: function (xhr) {
  
          },
          success: function (result) {
          },
          async: false,
          processData: false
      });
  }
  </code></pre>