I have created form nodes with template string but i need to work them on change.
I have tried .on('DOMNodeInserted')
but i haven't managed to catch the event. I also tried to work with promises, but i dont know if its possible to work on html nodes with promisses. Is there a way to trigger a event listener on a html object that have been appended later?
here is one of my many tries
$('.body').on('DOMNodeInserted', function(e) {
if($(e.target).children()[0] !== undefined){
let tema = $(e.target).children()[0].id;
tema.onchange = () => {
let el = manage(tema);
console.log(el);
}
}});
I