Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/04/2005, 09:17
angsanchez
 
Fecha de Ingreso: octubre-2004
Ubicación: España
Mensajes: 894
Antigüedad: 20 años, 6 meses
Puntos: 3
Hola, gerson
¿Has probado a ver qué valor devuelve el charAt?

Así parece que funciona:
Código PHP:
<script>
var 
vocales="aeiouáéíóú"
function lee(x)
{
    for (
i=0i<x.lengthi++)
    {
        if ( 
vocales.indexOf(x.charAt(i)) !=-alert(x.charAt(i) + " es vocal")
        else 
alert(x.charAt(i) + " no es vocal")
    }
}
</script>
<form>
<input type="text" name="entrada">
<input type="button" value="Leer" onClick="lee(this.form.entrada.value)">
</form> 
__________________
Angel :cool: