Мой друг работает над интересным веб-приложением Javascript, где вы вводите что-то в текстовое поле, и компьютер возвращает вам результат, но он чувствителен к регистру. Может ли он сделать это без учета регистра? Мы попытались использовать:Как сделать ввод текста в виде чувствительного текста?
var areEqual = string1.toUpperCase() === string2.toUpperCase();
, который был на JavaScript case insensitive string comparison, но он не может понять, как использовать.
function isValid() {
var password = document.getElementById('password').value;
if (password == "Shut Up")
{ alert('HOW ABOUT YOU!') }
else if (password == "No")
{ alert('You just did') }
else if (password == "Okay")
{ alert('Okay') }
else if (password == "DH36 Rocks")
{ alert('Check out his channel at www.youtube.com/dragonhe36!') }
else if (password == "LFH Sucks")
{ alert('We do not accept haters here.') }
else if (password == "Hello")
{ alert('Hi') }
else if (password == "Bored")
{ alert('Then check out www.youtube.com/laughforhelp!') }
else if (password == "I subed to LFH")
{ alert('Congrats!') }
else if (password == "I am an idiot")
{ alert('No youre not... Unless youre Giovanni.') }
else if (password == "Hi")
{ alert('Hello') }
else if (password == "Bye")
{ alert('Nooooo...') }
else if (password == "Is 0.999... equal to 1?")
{ alert('Yes') }
else if (password == "Yes")
{ alert('Um... Am I missing something') }
else if (password == "Go away")
{ alert('No.') }
else if (password == "I Like Pizza")
{ alert('So do I but I prefer tacos') }
else if (password == "...")
{ alert('...') }
else if (password == "Password")
{ alert('My password is much more secure') }
else if (password == "Typo")
{ alert('Waht? Where?') }
else if (password == "Type Something In")
{ alert('Type Something In') }
else if (password == "Bonjour")
{ alert('Comment ça va?') }
else if (password == "DH36 Sucks")
{ alert('I disagree') }
else if (password == "I agree")
{ alert('I disagree') }
else if (password == "Give Me Your Password")
{ alert('I forgot it') }
else if (password == "Is this a robot?")
{ alert('No, but maybe you are') }
else if (password == "Qwertyuiop")
{ alert('Asdfghjkl') }
else if (password == "I pooped my pants")
{ alert('I am glad to be a robot') }
else if (password == "I peed my pants")
{ alert('At least it is not water!') }
else if (password == "Nothing")
{ alert('That was something') }
else if (password == "This Website Sucks")
{ alert('You forgot the period.') }
else if (password == "This Website Sucks.")
{ alert('You forgot the does not inbetween Website and Sucks') }
else if (password == "When Is This Website Going To Be Edited?")
{ alert('LFH is deciding') }
else if (password == "DumbHead36")
{ alert('How did you know my password?') }
else if (password == "That Is Your Password?")
{ alert('No.') }
else if (password == "What Is Your Password?")
{ alert('I forgot it.') }
else if (password == "No It Was Not")
{ alert('Yes It Was.') }
else if (password == "A")
{ alert('BCDEFGHIJKLMNOPQRSTUVWXYZ') }
else if (password == "asd")
{ alert('That is what I name most of my files.') }
else if (password == "123")
{ alert('911') }
else if (password == "911")
{ alert('What is your emergency?') }
else if (password == "I am bored")
{ alert('So check out www.youtube.com/laughforhelp') }
else if (password == "9+10")
{ alert('21') }
else if (password == "I Do Not Want To")
{ alert('Wht Not?') }
else if (password == "Cause I Do Not Want To")
{ alert('Why Not?') }
else if (password == "I Got Hurt")
{ alert('Well, we cannot help you.') }
else if (password == "Why Not?")
{ alert('Because.') }
else if (password == "www.youtube.com/laughforhelp")
{ alert('It is so epic!') }
else if (password == "No It Is Not")
{ alert('Yes It Is.') }
else if (password == "My Name Is LFH")
{ alert('IMPOSTER ALERT!') }
else if (password == "www.laughforhelp.com")
{ alert('That is the Future!') }
else if (password == "www.laughforhelp.16mb.com")
{ alert('You are on that site right now.') }
else if (password == "Something Else")
{ alert('Really?') }
else
{ alert('Type Something Else') }
}
Спасибо, это сработало очень хорошо для меня и моего друга, все вы можете получить от меня большие пальцы, это решило мою проблему. Спасибо, много парней! :) – dragonhe36