How to delay execution in between the following in my javascript

后端 未结 4 1544
太阳男子
太阳男子 2020-12-03 20:38

I want to delay execution in betwen the follwoing codes:

$(\"#myName\").val(\"Tom\");
///delay by 3s
$(\"#YourName\").val(\"Jerry\");
//delay by 3s

$(\"#his         


        
4条回答
  •  没有蜡笔的小新
    2020-12-03 21:23

    You can use the setTimeout function. I think the syntax is

    window.setTimeout('$("#YourName").val("Jerry")',3000);
    

提交回复
热议问题