在我的代碼中,「SiAff」不會是正確答案... 我想使用「.toLowerCase」和「.toUpperCase」,但是我不知道該怎麼做。 任何幫助會感激JavaScript中的「Idiot Check」(.toLowerCase和.toUpperCase)
var Que = prompt("What's my name")
if (Que == "Siaff") {
document.write("Correct!")
}
else {
document.write("Wrong!")
}
'Que.toLowerCase()==「siaff'' ...? – deceze
你想實現什麼?代碼應該做什麼? – Cerbrus
歡迎來到SO。請訪問[幫助],看看有什麼和如何問。提示:顯示工作 - 例如google mdn toLowerCase閱讀如何使用toLowerCase - 或者:https://www.google.nl/search?q=how+to+compare+strings+case+insensitive+javascript哪些[返回重複](https://stackoverflow.com/questions/2140627/javascript-case-insensitive-string-comparison)作爲第一個 – mplungjan