<!-- 把下列代码加到<body>区域中 -->
<input type="button" value="动态添加" onclick="document.body.innerHTML+='<input>'">
<input type="button" value="看添加后" onclick="alert(document.body.innerHTML)">
<input type="button" value="保存变化后" onclick="saves()">
<script>
function saves(){
winSave=window.open('','','top=1000');
winSave.document.open ("text/html","gb2312");
winSave.document.write (document.body.innerHTML);
winSave.document.close ();
winSave.document.execCommand ('saveas','','');
winSave.close();
}
</script>