vendredi 29 mai 2015

how to dynamically enabled and disabled button when checkbox is checked and unchecked in semantic UI

how to dynamically enabled and disabled button when checkbox is checked and unchecked in semantic UI, ive spend so many times to do this small creepy codes

here is the html

<div class="ui fitted checkbox">
<input type="checkbox" > <label></label>
</div>
<div class="ui small positive disabled button" id="edit">
<i class="edit icon"></i> Edit
</div>

here is my javascript

<script>
    $(document).ready(function () {
                    if (
                    $('#cek').checkbox({
                        onChecked: function () {
                        }
                    })) {
                        $('#edit').removeClass('disabled');
                    } else {
                        $('#edit').addClass('disabled');       
                    }
                });
</script>

please help,thats make me crazy




Aucun commentaire:

Enregistrer un commentaire