Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda