Is it possible to get the html of a form with updated value attributes via the .html() function?
The (simplified) HTML:
<form>
<input type="radio" name="some_radio" value="1" checked="checked">
<input type="radio" name="some_radio" value="2"><br><br>
<input type="text" name="some_input" value="Default Value">
</form><br>
<a href="#">Click me</a>
The jQuery:
$(document).ready(function()
{
$('a').on('click', function() {
alert($('form').html());
});
});
Here is an example of what I am trying to do:
http://jsfiddle.net/brLgC/2/
After changing the value of the input and pressing "click me" it still returns the HTML with the default values.
How can I simply get the updated HTML via jQuery?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…