<html>
<head>
<script type="text/javascript">
function printpage()
{document. getElementById ('print').style.display='none';
window.print()
}
</script>
</head>
<body>
<td align="center">
<input name="print" type="submit" id="print" value="PRINT" onclick="printpage()" />
</td>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
单击时,将打开一个打印窗口.一旦我关闭打印窗口并再次打开然后单击打印,而不重新加载,则它将无法工作.