<!DOCTYPE html>
<html>
<body>
<table>
<tr>
<form name="foo" action="" method="get">
<td id="td">text: <input name="k" type="text" />
</td>
</form>
</tr>
</table>
<textarea rows="20" cols="50"></textarea>
<script type='text/javascript'>
var table = document.querySelector('table');
document.querySelector('textarea').value = table.innerHTML;
</script>
</body>
</html>