vendredi 29 avril 2016

Checkbox is unchecked but the content of a checked checkbox is showing up

Just like the title says. Here is my code:

$('#somediv').change(function() {
    if(this.checked) {
        $('.leaflet-marker-pane').show(1);
    }
    else {
        $('.leaflet-marker-pane').hide(1);
    }       
});

<input style="float: left;" type="checkbox" id="somediv" name="somediv">

This happens when the browser is refreshed. The content should not show up, because the checkbox is unchecked, but it is showing up.




Aucun commentaire:

Enregistrer un commentaire