Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

recorrer letra por letra js

function validarString (cadenaAnalizar) {
   for (var i = 0; i< cadenaAnalizar.length; i++) {
         var caracter = cadenaAnalizar.charAt(i);
         if( caracter == "ñ" || caracter == "Ñ") {
            alert("Caracter no permitido");
             return false;
          }  else {
             return true;
          }
    }
}
 
PREVIOUS NEXT
Tagged: #recorrer #letra #por #letra #js
ADD COMMENT
Topic
Name
7+6 =