A user writes 'football' into my input bar and then the action on line 6 and 7 executes.(用户将“足球”写入我的输入栏中,然后执行第6行和第7行的操作。)
But I what if the user writes "Football", with a capital letter?(但是,如果用户用大写字母写“足球”怎??么办?) I tried to implement the "logial or" ||(我试图实现“逻辑或” ||) but I couldn't get it to work.(但我无法正常工作。)
var input = document.getElementById("user_input");
let footballTeams = ["Manchester","Barcelona","Copenhagen"]
if (input.value == "football") {
alert("These cities have football teams:" +
"
" + footballTeams[0] + "," + " " + footballTeams[1] + "," + " " + footballTeams[2])
ask by Julius Nicolet Nielsson translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…