- <HTML>
- <HEAD>
- <META content="text/html;charset=gb2312" http-equiv="Content-Type">
- </head>
- <body>
- <script type="text/javascript">
- function saveas()
- {
- var winSave = window.open();
- winSave.document.open ("text/html","utf-8");
- winSave.document.write (document.getElementById("dataarea").value);
- winSave.document.execCommand ('SaveAs',true,'test.txt','.txt');
- winSave.close();
- }
- </script>
- <textarea id="dataarea">
- Test, just a test
- </textarea>
- <input type=button value="另存为" onclick="saveas()">
- </body>
- </html>
IE中保存textarea中数据为本地文件
最新推荐文章于 2020-06-19 09:14:22 发布