Home > front end >  Between two click on the button, pause a few seconds
Between two click on the button, pause a few seconds

Time:04-16

This is the first click button:
Var oBtn=document. GetElementsByClassName (" button_search ") [0];
OBtn. Click ();

This is click the second button:
Var oBtn1=document. GetElementsByClassName (" button_export_CSV ") [0];
OBtn1. Click ();

I want to click the first button, after the pause a few seconds, and then click the second button operation on


Found after baidu a lot of methods, the operation is paused a few seconds later, just click the first button operation on,,,

Have bosses know how to write

CodePudding user response:

 oBtn. Click (); 
SetTimeout ()=& gt; {
OBtn1. Click ();
}, 2000)

CodePudding user response:

The
reference 1/f, bubble fish _ response:
 oBtn. Click (); 
SetTimeout ()=& gt; {
OBtn1. Click ();
}, 2000)


I still have a problem, some long adjust time, request the second button

CodePudding user response:

refer to the second floor qq_41037215 response:
Quote: reference 1/f, bubble fish _ response:
 oBtn. Click (); 
SetTimeout ()=& gt; {
OBtn1. Click ();
}, 2000)


I still have a problem, adjust time longer, the second button, it won't be able to request


As long as the second button, as long as you don't do something else, you order first, waiting for you to set their own time, the second must perform, and if not, that's your own specific business code, not the function of the problem, you don't post code, no one knows what exactly do you do, how can you ensure fully fit actual demand you suggest?
  • Related