📅  最后修改于: 2022-03-11 15:03:12.338000             🧑  作者: 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