How to add 5 minute javascript countdown timer which submit a form

后端 未结 5 434
深忆病人
深忆病人 2021-01-03 12:27

I want to add 5 minute countdown timer which submit a form to my php page.

        
5条回答
  •  有刺的猬
    2021-01-03 12:50

    setTimeout() will fire a function SubmitForm after 300000 milliseconds = 5 minutes.

    function SubmitForm(){
        $("form").submit();
    };
    setTimeout(SubmitForm,300000);//5*60*1000
    

提交回复
热议问题