Morning people. How to make my javascript or jquery works in dynamically generated content. Basically, i have created web page that generates contents, base on wha
For dynamically generated elements you should delegate the events, you can use the on method:
on
$(function() { $(document).on('click', '#submitUser', function(e) { var fname = $("#fname").val(); $("#theresult").text(fname); e.preventDefault(); }); });
live() method is deprecated.
live()