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

181
Vistas
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
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