1//Normalize diacritics characters from originalText
2var originalText = "éàçèñ"
3var result = originalText.normalize('NFD').replace(/[\u0300-\u036f]/g, "")
4console.log(result)
1var originalText = "éàçèñ"
2var result = originalText.normalize('NFD').replace(/[\u0300-\u036f]/g, "")
3console.log(result)
1var accentArray = ["á","à","ã","â","é","è","ê","í","ì","î","õ","ó","ò","ô","ú","ù","û"]
2var stringToCheck = "áeiou"
3
4for(var i=0; i < stringToCheck.length; i++){
5 for(var j=0; j < accentArray.length; j++){
6 if(stringToCheck[i] === accentArray[j]){
7 alert("String has accents!");
8 }
9 }
10}