<input type="text" id="area" value="0" />
<input type="button" value="Insert!" id="but" />
<script type="text/javascript">
var node = document.getElementById('but'),
txt = document.getElementById('area');
node.onclick = function () {
txt.value++;
}
node.onmousedown = function () {
x = setInterval(function () {
txt.value++;
},
500);
document.onmouseup = node.onmouseup = function () {
clearInterval(window.x);
}
}
</script>