jQuery - Dynamically added content - Radio on change function -


i using ajax load popup containing different settings, including button ("click" event) , radio buttons ("change" event).

while "click" event works fine, (using following function)

$("#my_popup").on("click", '.my_button', function() {      "use strict";    // things }); 

... "change" event not. see corresponding function below:

$('#my_popup').on('change', 'input[name=input_name]:radio', function(){   "use strict";    if(condition) {     // other things    } else {     // other things   }  }); 

any ideas how make work? according dynamic event binding rules in thread believe should working fine...

html:

<div id="my_popup">       <input id="radio_1" type="radio" name="input_name">   <input id="radio_2" type="radio" name="input_name">    <!-- [...] --> </div> 

thanks in advance.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -