📜  选择时更改输入边框颜色 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:52.885000             🧑  作者: Mango

代码示例4
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