I need to reset all the form fields in an HTML content I saved in a variable. I searched the internet and here too. But none of what I\'ve found has worked yet. It won\'t su
This is a bit of a guess as I don't know what your mark-up looks like but jQuery 'find' may not work depending on how the html string is structured - have a look at this question -
Using jQuery to search a string of HTML
You could try looping through the 'content' string, then update each form element individually and add them to relevant container, something like -
$(content).each(function () {
if (this.nodeName == 'INPUT') $(this).val('');
if (this.nodeName == 'SELECT') $(this).children('option').prop('selected','');
$("#moveto").append(this);
});
Working demo - http://jsfiddle.net/vFMWD/5/