カップ麺.js

<div id="cnt"></div>
<script type="text/javascript">
	var cnt = 0;
	var div = document.getElementById('cnt');
	var countUp = function(){
		if(cnt > 180){alert('end!');}
		cnt += 1;
		div.innerHTML = cnt;
		setTimeout(countUp, 1000)
	}
	window.onload = countUp
</script>