I have a system that generates multiple address fields according the an amount selected by the user.
Initially I used $("input[name=inputname]")
which works fine for the initially loaded fiedls but doesn't work when adding more. Searching google and here led me to believe I could use JQuery's .on
function, although I can't seem to get it working, is there anything wrong with this code or do I need to approach this a different way?
$("div.data").on( "change", "input[name^=delivery-address-1]", function() {
alert( $( this ).val() );
});
Thanks in advance
EDIT: Hi, regarding the 'marked as duplicate', as I said I have read the similar answers and am aware of them, but the code learned from these answers doesn't seem to work in my situation and so was looking for further help, thanks.