Dynamically typed values are not part of what .html()
gets you. (This comes down to the difference between properties and attributes.)
You can however set the value
attribute of each input field to its current value, using something like this:
$('form input[type=text]').each(function() {
$(this).attr('value', $(this).val());
});
– then .html()
would get you those as well.
http://jsfiddle.net/b39xpoou/ (Simplified example, using a div element to output the HTML, using only text input fields, … but should be easy enough to adapt/modify.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…