我希望能夠懸停在一行上並突出顯示所有內容,但由於某些單元格具有不同的背景,因此我遇到了下面的代碼問題。tr onmouse events
<tr style="" onmouseover="this.style.background='Red';" onmouseout="this.style.background='#595959'" >
這是好的所有細胞都具有相同的背景,但如果我點擊單元格它強調它和onmouseout="this.style.background='#595959'"
總是復位。
我如何更改爲類似:
onmouseout="this.style.background='currentCellBGColor"
我會認爲它只是添加和刪除類而不是存儲和檢索特定樣式會更容易。 – j08691