Need help with this function


#1

Hi,

I need help with the following function in JS:

<div>
           
                    <h1>Ejercicio 12 </h1>
            
            <input type="text" id="Letra"><br>
            <input type="button" id="btnConfirmar" value="Confirmar"><br>
            
            <hr>
            
            <p id="pSalida11"></p>
            
            <hr>
            
            </div>


var r;
function procesarEjercicio12(){
    
    if(r==='a'||r==='e'||r==='i'||r==='o'||r==='u'||r==='A'||r==='E'||r==='I'||r==='O'||r==='U')

{

 $("#pSalida11").html("la letra " + r +  " ingresada es una vocal");

} 

else

{
        
  $("#pSalida11").html("no es una vocal");

}
}

When i put one of the vocals, nothing happend, what is wrong?


#2

you never call the function, there is no click event/listener.

functions only execute when called


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.