the node <'ul'> I received asynchronously contains <'li'> inputs. I need to add event to every li.
<ul class="parent">
<li><input id="red" type="checkbox"></li>
<li><input id="black" type="checkbox"></li>
<li><input id="white" type="checkbox"></li>
</ul>
As I understand I need to use smth like:
$(document).on('change', '.parent' ....})
And probably I need .each.
Can you describe how to use this functionality in this certain case?
` is added dynamically; your solution requires to reassign the event handler each time the list is loaded. Delegating doesn't.
– Sep 13 '21 at 12:44