<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<div id="oDiv" style="width:200px;height:100px;border:2px #ccc dashed;padding:10px">
<button οnclick="show7()">打字机</button>
</div>
<script type="text/javascript">
var typeString = "url为0时,表示刷新,与location.reload功能类似";
var count = 0;
var oBlock = document.getElementById("oDiv");
function type(){
if (count < typeString.length) {
oBlock.innerHTML = typeString.substring(0,count);
count ++;
}else{
window.clearInterval(intervalID);
}
}
var intervalID = window.setInterval(type,200);
</script>
</body>
</html>