Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
Javascript automatic click button but JUST one time

It's my code. This click goes on indefinitely. I would like to stop him after the first time.

<input type="button" name="submitbre" id="loadBtn" value="Load More">

<script>
var btn = document.querySelector("[name='submitbre']");
setInterval(function(){
btn.click();
},4000);
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to use setTimeout instead of setInterval. setTimeout will run the function just once, while setInterval runs the function periodically.

More info: https://javascript.info/settimeout-setinterval#:~:text=setTimeout%20allows%20us%20to%20run,repeating%20continuously%20at%20that%20interval.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!