您能告诉我下面的代码有什么问题吗?
//this code below is showing an error
First.addEventListener("keyup", function(event) {
// Number 13 is the "Enter" key on the keyboard
if (event.keyCode === 13) {
var input = document.getElementById("lastname")
//i will change the class in function below that's why i am changing it back for some reason
input.class === "margin5" ? input.class = "margin5 m-47" : console.log("false")
input.value = "what ever value i want"
changvaluE()
}
}
答案 0 :(得分:0)
重新格式化代码后,看来您缺少First.addEventListener(
的结尾')'。