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

331
Views
How to trigger a link in a tab of a table?

When a user is on the home page, he can click on a link that redirects him to another page (so far, it works). In the new page, I would like the link to automatically open the second tab of a table by doing an "auto click" (trigger).

The link of the home page is specific (it has an anchor). I managed to make a script that works, the problem is that if I open this page from the navigation menu, the second tab of the table still opens.

I would like that only the specific link can automatically open the second tab of the table.

Landing Page Service Page

Here is the code I used:

$(document).ready(function(){
    $('#test').click(function(){
        console.log('clicked');
       });
     // set time out 5 sec
        setTimeout(function(){
           $('.et_pb_tab_3 > a').trigger('click');
       }, 500);
       console.log('triggered');
   });

Thanks a lot for helping.

Best regards,

Johann

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

0

A url parameter may get the job done for you. From the link you want to open you could do something like: example-link.com?showTable=True.

Then look for that url parameter on the new page and only open if it's there and True.

example-link.com#rebozo?showTable=True

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const product = urlParams.get('showTable')
if (showTable && showTable === 'True') {
    // code to open the table
}

https://www.sitepoint.com/get-url-parameters-with-javascript/

about 4 years ago · Juan Pablo Isaza Report

0

Ok so it was easy and i'd like to thanks @Branson Smith for inspiration.

i just had i conditional statement to check if there is a hash in the url :

if (window.location.hash == '#myHash') {
    $(document).ready(function(){
        $('#myID').click(function(){
            console.log('clicked');
           });
            setTimeout(function(){
               $('.myClass > a').trigger('click');
           }, 2000);
           console.log('triggered');
       });
};
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!