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

143
Vistas
How to produce an effect when a checkbox button is checked while using jQuery?

I'm trying jQuery from scratch & I want to produce an effect when a checkbox button was checked, with jQuery. But I'm not having the effect I want.

<div>
    <input type="checkbox" id="cb">
    <label for="cb">Show Button</label>
</div>
<button id="but">
    Button
</button>

$(() => {
    $("#but").hide();
    $("#cb").on("change", () => {
        if($(this).is(":checked")) {
            $("#but").show();
        }
    });
});

I realized it is not entering to the if block. I guess checked prop should be called on a different way? How can I make this work?

about 4 years ago · Juan Pablo Isaza
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