hola,
aunque el amigo SARUMAN me ganó de mano (y casi con el mismo codigo), te pongo algo similar que hice y que te devuelve el valor al mismo input.
Cita: <html>
<head>
<script>
function may(nn){
nombres=nn.value.split(" ");
for(x=0;x<nombres.length;x++){
nombres[x]=nombres[x].slice(0,1).toUpperCase( )+nombres[x].slice(1);
}
nn.value=nombres.join(" ");
}
</script>
</head>
<body>
<form action="formulario" method="get">
<input name="nombre" type="text" onkeyup="may(this)">
<input name="apellido" type="text" onkeyup="may(this)">
</form>
</body>
</html>
saludos