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

131
Visualizações
How to add only one click event on a label?

Hello i'm trying to add an event of click on a button when the user click a label,
its working fine but the user have to click on the label twice i need to make it work from the first click
this is my function :


(function($){



$('.next-on-click .forminator-checkbox-label').on('click', function() {
    $('button.forminator-button.forminator-button-next').trigger('click');
});




})(jQuery);

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

example:

$('.next-on-click .forminator-checkbox-label').on('dblclick', function() {
    $('button.forminator-button.forminator-button-next').trigger('click');
})
about 4 years ago · Juan Pablo Isaza Relatório

0

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<lable class="next"> Next </lable>
<button class="check">Check</button>

<script>
$('.next').click(function() {
alert("Hi");
    $('button.check').trigger('click');
});
</script>

about 4 years ago · Juan Pablo Isaza Relatório

0

So why would you need JavaScript to handle the click? Adding an for attribute on a label will click the button.

$("#btn").on("click", function () {
  console.log("clicked");
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label for="btn">Label</label>
<button id="btn">Button</button>

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