新的一天

This commit is contained in:
syx_computer
2025-10-15 17:48:32 +08:00
parent 61ec7c9468
commit 8150aa63d1
8 changed files with 239 additions and 231 deletions

View File

@@ -259,7 +259,15 @@
<script>
//通过JS为上述的表格中数据行添加事件监听, 实现鼠标进入后, 背景色#f2e2e2; 鼠标离开后, 背景色需要设置为#fff; (JS新版本的语法)
let trs = document.querySelectorAll('tbody tr');
trs.forEach(tr => {
tr.addEventListener('mouseenter', () => {
tr.style.backgroundColor = '#f2e2e2';
})
tr.addEventListener('mouseleave', () => {
tr.style.backgroundColor = '#fff';
})
})
</script>
</body>
</html>