title: Jquery Ajax function clear text after submit
body: <p>I using Jquery Ajax function login. Now what I want to do is clear the input text after click the button submit.</p>
  
  <p>Here it's my JS code</p>
  
  <pre><code>$(document).ready(function()
      {
          $("#login").click(function()
          {
              var action = $("#login_form").attr('action');
              var form_data =
              {
                  username: $("#username").val(),
                  password: $("#password").val(),
                  ajax_login: 1
              };
  
              $.ajax(
              {
                  type: "POST",
                  url: action,
                  data: form_data,
                  success: function(response)
                  {
                      if(response == 'success')
                          window.location.replace("home");
                      else
                          $("#message").html("&lt;div class='error_log'&gt;&lt;p class='error'&gt;Invalid username and/or password.&lt;/p&gt;&lt;/div&gt;");  
                  }
              });
              return false;
          });
      });
  </code></pre>
  
  <p>Anyone have an suggestions ?
  Thanks for help.</p>