1<!-- Find values of checked boxes with jquery -->
2<div class="fruit">
3 <label>
4 <span>Apple</span>
5 <input onchange="checkValues()" name="apple" type="checkbox" value="apple">
6 </label>
7
8 <label>
9 <span>Banana</span>
10 <input onchange="checkValues()" name="banana" type="checkbox" value="banana">
11 </label>
12
13 <label>
14 <span>Grape</span>
15 <input onchange="checkValues()" name="grape" type="checkbox" value="grape">
16 </label>
17</div>
18
19<script>
20 function checkValues() {
21 $('.fruit input:checkbox').each(function(index, element) {
22 if (element.checked === true) {
23 console.log(element.value)
24 }
25 });
26 }
27</script>