title: How to disappear message in 4 to 6 seconds using jquery
body: <p>I can display the message using javascript/jquery and i have ajax request but that message is not disappearing after some seconds and i want to disappear it.</p>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>$('#password_change_form').submit(function(e) {
  
      e.preventDefault();
      var saveThis = $(this);
  
      $.ajax({
          type: "POST",
          url: "/changepassword",
          data: $(saveThis).serialize(),
          success: function(data) {
              $(".success-messages").text("Heslo bylo úspešne zmeneno").fadeIn();
  
              setTimeOut(function(){
                  $(".success-messages").fadeOut('slow');
              },2000);
  
              $('#password_change_form').trigger("reset");
  
          },
          error: function (data) {
              $(".error-messages").text("Zadali jste špatné heslo").fadeIn();
  
              setTimeOut(function(){
                  $(".error-messages").fadeOut('slow');
              },2000);
  
              $('#password_change_form').trigger("reset");
          }
  
      });
  }),
  </code></pre>
  
  <p>I have setup a setTimeOut function but its not working i dont kno where is the issue:
  Your help needs here!</p>