Say I have: <div id="abc"> <input type="text" name="myname" value="TEST"> </div> Code (markup): if I use abc.innerHTML, I won't get the new value for the text field (if changed by the user). What would be the best way to accomplish fetching the new value to "properly" copy the HTML?
Using the "id" and "name" properties with "input" fied. That way works on Explorer and FireFox. Example: <html> <body> <div id="abc"> <input type="text" id="myname" name="myname" value="TEST" size="11" maxlength="20"/> <br /> <button type="button" onclick="JavaScript: alert( document.getElementById('myname').value );">Alert Value</button> </div> </body> </html> Code (markup):