jeudi 7 décembre 2017

DOM remove a checkbox javascript

I'm quite new to Javascript and don't know where to start for this one. I have a list of checkboxes. I want to achieve when a checkbox is checked, the checkbox is removed from the list. I found some different solutions but they all have a button you need to press to remove the checkbox and i just want the checkbox removed when it's checked.

This is how my HTML looks like:

<ul class="list-group">
                    <li class="list-group-item">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox"> Item 1
                            </label>
                        </div>
                    </li>
                    <li class="list-group-item">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox"> Item 2
                            </label>
                        </div>
                    </li>
                </ul>




Aucun commentaire:

Enregistrer un commentaire