I am making a search function as an assignment. I however cant seem to trigger a change
event I made with jQuery. The HTML structure is built by the same script with this in the bottom.
$('.receptenFilter input:checkbox').on('change', function(e) {
console.log('changed')
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<div class="receptenFilter">
<div class="ingredienten">
<ul id="ingredientenHolder">
<li><input type="checkbox" name="ingredientFilter" value="Gevogelte"></li>
</ul>
</div>
<div class="gerei">
<ul id="gereiHolder">
<li><input type="checkbox" name="gereiFilter" value="186"><img src="../../images/icons/32px/186.png" alt=""></li>
</ul>
</div>
</div>
This does not seem to trigger the console.log
. Should I select each thing down the line? div div ul li input
? I was under the impression it searched down the line.
Can someone help?