中文(繁体)
<!-- 將下列程式碼加到<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>