我是Java的新手,对此不太了解。但是,我设法创建了一个倒计时计时器,该计时器可以像我希望的那样正常工作。这很简单,但是基本上它是一个倒计时到特定日期的计时器,一旦到达指定的日期和时间,它就会显示我可以自定义的文本。我希望这段代码能够在倒数到零时显示带有超链接的按钮。这是我到目前为止的代码:
// Set the date we're counting down to
var countDownDate = new Date(Date.now() + 20000).getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours …Run Code Online (Sandbox Code Playgroud)