lundi 30 mars 2015

Is there a function that will ignore capital letters in javascript?

i have a chatbot that answers questions only if i write them the same way as in the code Ex: If i wrote the tag "Hello" it will not answer if i say in the chatbot "hello" . I have to write it with a capital letter like in the code. Is there a function that will ignore that and answer it even if i write it "HeLlO"?



if (message.indexOf("Bye")>=0 || message.indexOf("bye")>=0 || message.indexOf("Goodbye")>=0 || message.indexOf("Goodbye")>=0 ){
send_message("You're welcome.");
}

Aucun commentaire:

Enregistrer un commentaire