Событие нажатия JQuery не работает для динамически создаваемых кнопок ⇐ Jquery
Событие нажатия JQuery не работает для динамически создаваемых кнопок
I am able to create components dynamically, but click event is not working on dynamically created buttons.
Here is the code.
HTML file:
+ Add Merge Section JS File:
$('.add_mer_sec').click(function () { var cur_ms_len = $('.merge_sections').children().length + 1; console.log('cur_ms_len --> ', cur_ms_len) $('.merge_sections').append(` Select Product - Remove Merge Section `); }); // I am able to create components dynamically. $(document).on('click', '[class^="rem_mer_sec-"]', function() { console.log('INNNNN'); //This is not working }); Please help me, Thanks.
Источник: https://stackoverflow.com/questions/781 ... ed-buttons
I am able to create components dynamically, but click event is not working on dynamically created buttons.
Here is the code.
HTML file:
+ Add Merge Section JS File:
$('.add_mer_sec').click(function () { var cur_ms_len = $('.merge_sections').children().length + 1; console.log('cur_ms_len --> ', cur_ms_len) $('.merge_sections').append(` Select Product - Remove Merge Section `); }); // I am able to create components dynamically. $(document).on('click', '[class^="rem_mer_sec-"]', function() { console.log('INNNNN'); //This is not working }); Please help me, Thanks.
Источник: https://stackoverflow.com/questions/781 ... ed-buttons
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение