I used to activate a function of a selection menu with options with this :
$("[name='MyMenu']" ).selectmenu({
select: function(){
And functions of inputs with
$("[name='MyInput']" ).keyup(function(){
And it worked fine, but now my menu is dynamically generated. So I found close questions using .on() with the closest fixed parents. It worked fine with the "click" or "keyups" for other elements that I generate dynamically. Example of the code I use for the keyup :
$("#ParentElement").on("keyup","[name='MyInput']",function(){
But didn t work with the selectmenu. I tried :
$("#ParentElement").on("selectmenu", "[name='MyMenu']",function(){
It shows no errors but the function is not executing.
$("#ParentElement").on("selectmenu", "[name='MyMenu']",select:function(){
Shows an error.
I think I have to place somewhere that 'select :' but I am no JS expert, everytime I put it somewhere it shows an error. How to make a selectmenu with a 'select : function()' work properly ?