setInterval与clearInterval的代码,为什么只能运行一次? <input type="button" value="start" onclick="h=setInterval('showTime()',1000);"/> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><script>var h=null;function showTime(){ var today = new Date(); document.getElementById("test").innerHTML = "The time is: " + today.toString();}</script><body><span id="test" ></span><a style="display:none" href="http://silverlight.net/showcase/">silverlight</a><input type="button" value="stop" onclick="if(h===null)return;clearInterval(h);h=null"/><input type="button" value="start" onclick="if(h!=null)return;h=setInterval('showTime()',1000);"/></body></html> gmap拉框查询的问题 document.getElementById在IE中运行报错 100 分求 jquery 点击up按钮实现图片排序 javascript问题 求一个JS能屏蔽当前网页的工具栏 怎樣設置重疊的表單對象啊? 关于 修改JS代码:鼠标触发,条件隐藏--为了更加美观 谁能给我一个类似CSDN社区左边这个树型菜单效果?只要静态的就可以,开帖再加500分!! 哪有JavaScript的帮助文档啊? 怎么根据一个文本框的数字来动态的修改input的数目呢? 如何在javascript里更改调用的函数? 追加分
<script>
var h=null;
function showTime()
{
var today = new Date(); document.getElementById("test").innerHTML = "The time is: " + today.toString();}
</script>
<body>
<span id="test" ></span><a style="display:none" href="http://silverlight.net/showcase/">silverlight</a>
<input type="button" value="stop" onclick="if(h===null)return;clearInterval(h);h=null"/>
<input type="button" value="start" onclick="if(h!=null)return;h=setInterval('showTime()',1000);"/>
</body>
</html>