<script type="text/javascript">
window.onload = function () {
setInterval(function () {
document.getElementById('txt1').value++;
if (document.getElementById('txt1').value == 10) {
location.href = 'http://www.luofenming.com';
}
},1000)
}
</script>
//setTimeout用法也差不多 不过 只是执行一次
<input id="txt1" type="text" value="0">