クラスを追加し (私の例では "tablecell")、bgcolor を削除します。
CSS の方法:
.tablecell:hover {
background-color:#000000; // Put color you want it to be on hover here.
}
.tablecell {
background-color:#FF0000; // Put color you wan tit to be on not-hover here (optional)
}
Javascript の方法:
myElement.addEventListener("onmouseover", mouseIn);
myElement.addEventListener("onmouseout", mouseOut);
function mouseIn() {
this.style.backgroundColor = "#000000";
}
function mouseOut() {
this.style.backgroundColor = "#FF0000";
}
jQuery の方法:
$(".tablecell").on("hover", mouseIn, mouseOut); // functions above