html+css+js 使用onmouseout与onmouseover
<td id="head">头痛td>
tr>
<tr>
<td id="throat">喉咙痛td>
tr>
<tr>
<td id="back">腰痛td>
tr>
<tr>
<td id="stomach">肚子痛td>
tr>
tbody>
table>
<div class="detail1"> 感染新冠后的头疼,临床表现为一侧或双侧枕部持续性钝痛,并伴阵发性加剧,可向头顶或外耳部放射div>
<script>
var head=document.getElementById("head");
var detail1=document.getElementsByClassName("detail1");
head.onmouseover.function(){
detail1.style.display="block";
}
head.onmouseout.function(){
detail1.style.display="none";
}
script>
为什么这个script里面写的onmouseover函数没有实际效果
```javascript
// 方法1
head.onmouseover=function(){
detail1.style.display="block";
}
// 方法2
head.addEventListener('mouseover',function(){
detail1.style.display="block";
})
```