jQuery autohide element after 5 seconds

前端 未结 8 1402
刺人心
刺人心 2020-11-29 17:53

Is it possible to automatically hide an element in a web page 5 seconds after the form loads using jQuery?

Basically, I\'ve got

8条回答
  •  日久生厌
    2020-11-29 18:51

    You can try :

    setTimeout(function() {
      $('#successMessage').fadeOut('fast');
    }, 30000); // <-- time in milliseconds
    

    If you used this then your div will be hide after 30 sec.I also tried this one and it worked for me.

提交回复
热议问题