Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

133
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda