I\'m adding select elements dynamically, like in the below HTML. I\'m not sure why the .on(\'change\' ...) is not working for the dynamic select. What am I missing?
<
Your code:
$('#x select').on('change', function () { alert('helo'); })
attaches an event handler to the select inside the #x element.
What you want (from what i understood) is something in the lines of:
$("#y").on('change','select',function () { alert('helo'); });
This attaches an event handler to the #y element that gets delegated to its children 'select' elements
From http://api.jquery.com/on/
The .on() method attaches event handlers to the currently selected set of elements in the jQuery object.