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

149
Views
Clicking the navbar item using scripts

What should i replace to click this navbar called security printing? Im new with laravel.

$('.anotha').on('click', function () {
if ($(this).on(':clicked')) {
    $('#secur').clicked();
   }
})

I know its wrong code. But I tried

$('.anotha').on('click', function () {
if ($(this).on(':clicked')) {
    $('#secur').click();
   }
})

Nothing happened too, still the current active navbar is the about us

$('.anotha').on('click', function () {
if ($(this).on(':clicked')) {
    $('#secur').show();
}
});

Nothing happened because the tab-item is already showed. same as

$('.anotha').on('click', function () {
if ($(this).on(':clicked')) {
    $('#secur').select();
   }
})

and

$('.anotha').on('click', function () {
if ($(this).on(':clicked')) {
    $('#secur').selected();
   }
})

enter image description here

UPDATE:

When I remove the if clause the code will look like this:

$('.anotha').on('click', function () {
    $('#secur').selected();
})

Same as other code but nothing happened still.

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

0

Every HTML element has a click() method that can be called to simulate a mouse click.

    document.getElementById('#secur').click();

jQuery provides it's own method that wraps this feature.

$('.anotha').on('click', function () {
    $('#secur').click();
})

By the way, this does not require jQuery to accomplish. The following code would be the equivalent in plain javascript.

let a = document.querySelectorAll('.anotha');
let s = document.querySelector('#secur');

a.forEach(x => {
    x.addEventListener('click', event => {
        s.click();
    });
});

s.addEventListener('click', event => {
    console.log('#secur was clicked');
});
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!