Hola:
Yo le añadiría el
onmouseout por si nos salimos del enlace, ya que empieza a funcionar anómalamente si forzamos varios
onmousedown sin que haya
onmouseup:
Código PHP:
<html>
<head>
<script type="text/javascript">
var tempo;
var suma = 0;
function sumar() {
suma += 10;
document.getElementById('algo').value = suma;
}
</script>
</head>
<body>
<a href="#" onmousedown = "tempo=setInterval('sumar()',500); return false"
onmouseup = "clearInterval(tempo)" onmouseout="clearInterval(tempo)">Sumar</a>
<input type="text" id="algo" value="0" />
</body>
</html>
Un saludo.