Suppose I loaded the field through an AJAX and inserted it into the document via html (), after I changed it, how do I get the new value of this field? When called, its value returns undefined.
function set() { $.ajax({ type: 'GET', url: 'blablabla', success: function(res) { $('#section').html(res); } }); } function get() { var input = document.getElementById('input').value; alert(input); }
Well, this is the field itself.
<input type="text" id="input" value="" onchange="get()">