About $(document).on(change

Hello,

Another group with ajax is loaded on the page when one group radio button is clicked

The problem is:
This code belongs to single radio button group
id=“dvr_getir” works because there is a radio button, no problem
$(document).on('change', '#dvr_getir', '.dvr_getir', function(){

does not work with class
How can this problem be solved?
$(document).on('change', '.hdd_getir', function(){

However, the ID you have multiple radio groups overlaps

Note: The radio groups are loaded with ajax.

The reason this doesn’t work for ajax added contents is because that content doesn’t exist when the event listener is created. If you search the web for ‘jquery event delegation’ you can find out how to solve this.

You will need to attach the event listener to some container that does exist, that the ajax added content will be placed into.

We are novice,
Of course we search in advance, we ask for help when we cannot find, the reason we couldn’t find, we don’t know what to search for
when we search with the right word we find, but we don’t know what the correct word is
In this case, we ask for help here

I solved the problem this way, I found in search

$('body').on('change', 'input[name="secilen_dvr"]', function() {

Thank you

Sponsor our Newsletter | Privacy Policy | Terms of Service