📜  如何通过内联 css 代码示例应用悬停

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

代码示例1
document.getElementById("mydiv").onmouseover= function(e){this.className += ' my-special-class'; };
document.getElementById("mydiv").onmouseleave= function(e){this.className = this.className.replace('my-special-class',''); };