gpt4 book ai didi

javascript - onmouseover 时更改背景图像

转载 作者:行者123 更新时间:2023-11-30 11:24:35 25 4
gpt4 key购买 nike

<分区>

function change(ele) {
document.getElementById('info').innerHTML = ele.alt;
document.getElementById('info').style.backgroundImage = "url(ele.src)";
}
<div id='info'>
This will tell you more about the below image
</div>
<div id='container'>
<div>
<img alt="The mini Barbarian" src="img\barbarian-thumb.jpg" class="pics" onmouseover="change(this)">
</div>
</div>

我如何用鼠标悬停在带有id conatiner的div标签中的图像更改带有id信息的div的背景图像

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com