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

135
Views
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
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!