<!-- 把下列代碼加到<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>