L
L
lexstile2017-01-29 03:33:32
JavaScript
lexstile, 2017-01-29 03:33:32

How to activate the desired checkbox by clicking on the parent?

There is a code:

<li class="list-group-item">
                        <div class="material-switch pull-right">
                            <input id="cr" onclick="func();" checked="" type="checkbox" name="cr"/>
                            <label for="cr" class="label-default"></label>
                        </div>
                    </li>

How to activate the required input through JS when clicking on it? (When clicking on list-group-item)
There is not one input, so you need to activate exactly the one you clicked on.
dropmefiles.com/AgxO0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Victor Oberemko, 2017-01-29
@lexstile

lexstile , if I understood the task correctly, then this is how you can - codepen.io/swistikkk/pen/GrOaRv
I set the styles purely for myself)

O
Oleg, 2017-01-29
@politon

As an option like this https://jsfiddle.net/Politonius/Lzkzon6L/
or like this https://jsfiddle.net/Politonius/Lzkzon6L/1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question