например так
<html>
<head>
<script type="text/javascript">
function color() {
document.getElementById("res").innerHTML = ("<br>" + 1);
}
function func() {
id = setInterval('color()',100);
}
function off() {
clearInterval(id);
}
</script>
</head>
<body >
<input type='button' value='Старт' onclick='func()'>
<input type='button' value='Стоп' onclick='off()'>
<div id="res"></div>
</body>
</html>