是可以的,
但是你需要自己寫一個函數,
而後將window.print()和一個<input type=hidden id=currentdate style='visibility=hidden'>放在函數裡面,打印時再在javascript中將當前日期寫到currentdate,再將它的visibility='',window.print()就可以。
但是你需要自己寫一個函數,
而後將window.print()和一個<input type=hidden id=currentdate style='visibility=hidden'>放在函數裡面,打印時再在javascript中將當前日期寫到currentdate,再將它的visibility='',window.print()就可以。
var loNow = new Date();
lod.innerHTML = loNow.getYear() + "年" + (loNow.getMonth()+1)+"月"+ loNow.getDate()+"日";
document.body.appendChild(lod);
window.print();
@media screen{.printOnly{display:none}}
</style>
<span class=printOnly><script>with(new Date()){document.write(getFullYear()+"年"+(getMonth()+1)+"月"+getDate()+"日")}</script></span>