Thanks for your attention.
I have a DOM in which one I dynamicly insert a JS script element using :
var script = document.createElement("script");
script.id = "dynJS";
script.type = "type/javascript";
document.body.appendChild(script);
Some events later, I generate buttons in the page. Then, I add the following code in this script element to listen the click on these buttons :
$(document).ready(function(){
$(document).on("click", "button#but1", function(){
alert("click A");
}
}
(respectively for the other buttons)
But the click isn't detected. Does anyone know why ?
EDIT : Problem solved.
Thanks to the comments, I fix the issue moving the delegated click listener in a code pre-existing the buttons add, avoiding the redundant script add.
Thanks a lot for the help.