📅  最后修改于: 2022-03-11 14:47:52.885000             🧑  作者: Mango
document.getElementById("fName").className = document.getElementById("fName").className + " error"; // this adds the error class
document.getElementById("fName").className = document.getElementById("fName").className.replace(" error", ""); // this removes the error class