I already wrote some syntax and it's WORK if the element is not DOM, but when the new DOM element added by appending some html to some div, the syntax won't work to the new element.
Please look at this code, i'm confused
$('.undistributed-row-tr').each(function() {
$(this).on('click', function() {
if($(this).find('.undistributed-check-one').is(":checked")){
$(this).find('.undistributed-check-one').prop('checked', false);
}else{
$(this).find('.undistributed-check-one').prop('checked', true);
}
})
})
I'am using Ruby on Rails and jQuery. Thank you!
For detail code and demo, please click this link: