-2
Hello, I need to know what kind of data is being inserted into the HTML input, I have to know if what is there is text(string) or if it is a number. And then I create a vector using the slipt. It’s always returning Number
let valores = $('#valores').val();
if(isNaN(valores) === true){
console.log('Número');
} else {
console.log('Letra');
}
let dados = valores.split(';');
Hello from a read on this link may be a light for your question, try to edit your post and add more details. already good luck! https://forum.imasters.com.br/topic/537487-como-verificar-tipo-de-valor-inserido-no-input/
– Dione Carlos
What values did you use to test? If you are going to split later, then you will not only have numbers, please edit the question and put the strings you are using and what should be the result
– hkotsubo
Matheus, do you realize that
NaN
means "Not a Number"? That is, yourif
makes "Ifvalores
is not a number, log 'Number'"... It makes no sense– fernandosavio