Hola:
No sé si te he entendido:
Código:
<html>
<head>
<script type="text/javascript">
var cuenta = 0;
function sumar() {
document.forms.contador.cuenta.value = ++cuenta;
}
</script>
</head>
<body >
<form name="contador" >
<input type="text" name="cuenta" />
<button onclick="sumar()" >cuenta</button>
</form>
</body>
</html>
Saludos