javascript - jQuery dynamic DOM elements are not posted in PHP -


i have button id btngo wrapped in form id frmnewrequest. when tried use

$('#frmnewrequest').on('click', '#btngo', (function(e){ //do })); 

it not working when changed

$('#btngo').click(function(e){ //do }); 

it working. different between 2 ?

i have dom dynamically generated upon click of btngo, when posted codeigniter's controller, newly dom elements not posted. what's problem ?

first snippet of code tries click on form. there not method click on form element. so, not work.

whereas second snippet clicking on button , button have property click so, work you.


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 -