<Script Language="JavaScript"> var timedate= new Date("October 1,2002"); var times="国庆节"; var now = new Date(); var date = timedate.getTime() - now.getTime(); var time = Math.floor(date / (1000 * 60 * 60 * 24)); if (time >= 0) document.write("现在离"+times+"还有: "+time +"天")</Script>
2.单击按钮打印出当前页
<Script Language="JavaScript"> <!-- Begin if (window.print) { document.write('<form>' + '<input type=button name=print value="打印本页" ' + 'onClick="javascript:window.print()"></form>'); } // End --> </Script>