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

191
Views
How to click on a button(no Id in tag) in html page after 5 seconds when page is loaded

A boog noob Alert!...I've html div like this

<div class="col mt-2">
<button @click="selected = Array.from(header); render()" class="btn btn-light-alt btn-sm">Select all</button>
<button @click="selected = []" class="btn btn-light-alt btn-sm">Clear selection</button></div>
    

All I want to do is click on this Select all button after 5 seconds webpage is loaded. I've searched for this way to do it & I found this

setTimeout(document.getElementByID('button').click(),5000);

I think button is Id here???...But there is no Id in my html tag...we can see only class is available...so can I achieve this requirement?...Any similar threads that you guys know?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you can't modify the HTML, and that button's function is always the same, then you don't actually need to trigger the click. Just run the functions.

setTimeout(function(){
   selected = Array.from(header);
   render();
},5000);
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!