怎么在<div>里调用js函数
从网上找的正计时代码`<scripttype="text/javascript"language="javascript">functionthenceThen(time...
从网上找的正计时代码 `<script type="text/javascript" language="javascript"> function thenceThen(timespan) { var date1 = new Date(timespan); var totalSecs = (new Date() - date1) / 1000; var days = Math.floor(totalSecs / 3600 / 24); var hours = Math.floor((totalSecs - days * 24 * 3600) / 3600); var mins = Math.floor((totalSecs - days * 24 * 3600 - hours * 3600) / 60); var secs = Math.floor((totalSecs - days * 24 * 3600 - hours * 3600 - mins * 60)); document.getElementById("thenceThen").innerText = timespan + "距今:" + days + "天" + hours + "小时" + mins + "分钟" + secs + "秒"; } var clock; window.onload = function() { clock = self.setInterval("thenceThen('2016/06/08')", 500); } 效果如下 ![图片说明](http://img.ask.csdn.net/upload/201607/19/1468860482_813666.png) 我想把以上的天、时、分、秒单独放在下面的几个<div>里,让每个框显示对应的数据 <div class="dash days_dash wow zoomIn" data-wow-delay="0.4s"> <div class="digit"> </script></div> <span class="dash_title">days</span> </div> <div class="dash hours_dash wow zoomIn" data-wow-delay="0.5s"> <div class="digit">hours</div> <span class="dash_title">hours</span> </div> <div class="dash minutes_dash wow zoomIn" data-wow-delay="0.6s"> <div class="digit">mins</div> <span class="dash_title">minutes</span> </div> <div class="dash seconds_dash wow zoomIn" data-wow-delay="0.7s"> <div class="digit">secs</div> <span class="dash_title">seconds</span> </div> ![图片说明](http://img.ask.csdn.net/upload/201607/19/1468860546_102250.png) 请问代码要如何删改?
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询