如题
<html>
<head>
<script language="JavaScript"><!--
function save()
{
var meizzWindow = window.open("","_blank");
var s = "<html>\r\n";
s += "<head>";
s += "<LINK href=css.css type=text/css rel=stylesheet>";
s += "<meta http-equiv=Content-Type content=text/html; charset=gb2312>";
s += "</head>";
s += document.body.outerHTML;
s += "</html>";
meizzWindow.document.write(s);
meizzWindow.document.close();
meizzWindow.document.execCommand(SaveAs);
meizzWindow.close();
}
//--></script>
</head>
<body>
<input type=button value=ok onclick="document.getElementById(mm).innerText=abcd">
<input type=button value=save onclick="save()">
<table border=1 width=100>
<tr><td id=mm></td></tr></table>
</body>
</html>