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

169
Views
After "go to previous page" checkbox remains checked, but won't be detected by jquery

I have an array of checkboxes which can be used in a sort of calendar app. Whenever the checkbox gets checked, a label should become visible. My HTML looks something like this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    CheckVisibility();
})

function CheckVisibility(){
  if($('#cb').is(':checked')){
    $('#label').show()
  }
  else{
    $('#label').hide()
  }
}
</script>
<table>
    <tr>
        <td><input type=checkbox id="cb" onchange="CheckVisibility()"/></td>
        <td><label id="label" style="display : none">Monday</label></td>
    <tr>
</table>

And it works fine on first load. However, when I return to the previous page, the checkbox is still checked. This is the behaviour I want, but it won't get registered as "checked" when passing $(document).ready fires of CheckVisibility(). Any idea's?

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!