手记

计时器及调用文本框用onmouseover

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>计时器</title>
<script type="text/javascript">
var num=0;
function startCount() {
document.getElementById('count').value=num;
num=num+1;
setTimeout("startCount()",1000);
}
</script>
</head>
<body>
<form>
<input type="text" id="count" onmouseover="startCount()"/>
</form>
</body>
</html>

1人推荐
随时随地看视频
慕课网APP

热门评论

灵活运用,onmouseover这些调用方法要经常用

查看全部评论