I am writing a web application where i have to send HTML from the DOM along with values of respective text areas and textboxes. Currently , I am using innerHTML for accomplishing this.
Lets suppose we have an html script
<div id="abcd">
<form id="form1" >
<input type="text" id="input1" />
</form>
</div>
Now, on the html page in browser, I fill the text box with some value (say - "12345"). And, I try to capture complete html using
var x = $("#abcd").html(); // or
var x = document.getElementById("abcd").innerHTML ;
All I get in x is
<div id="abcd">
<form id="form1" >
<input type="text" id="input1" />
</form>
</div>
Although I wanted something like -
<div id="abcd">
<form id="form1" >
<input type="text" id="input1" value="abcd" />
</form>
</div>