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

107
Views
Detectar evento de clic/cambio de casilla de verificación en Chrome 93 para escritorio

Este código:

 <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" role="switch" id="switchService"> <label class="form-check-label" for="switchService">Service</label> </div> $("#switchService").on('click', function() { alert($(this).is(':checked')); });

funciona en Firefox y en Chrome para Android. Pero en Firefox 93 for Desktop (Windows 7) no activa el evento.

También probé muchas sintaxis diferentes como:

 $("#switchService").on('click', function() { $("#switchService").on('change', function() { $("#switchService").change(function() {

Todo lo anterior funciona en todos los navegadores que probé, excepto Chrome 93 para escritorio.

¿Hay una sintaxis específica para ello? Por supuesto, javascript está habilitado, ya que otros scripts funcionan bien.

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

0

Puede evitar las dificultades de tipo "condición de carrera" mencionadas por @RoryMcCrossan si usa la delegación de eventos como se muestra aquí:

 $("body").on("click","#switchService", function() { ... }) .on("change","#switchService", function() { ... }) .on("change","#switchService", function() { ... });
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!