<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>网页标题</title> </head> <body> <img src="images/jd1.png" Id="replace" /> <script type="text/javascript"> var sac = document.getElementById("replace") sac.onmouseover=function(){ sac.src = "images/jd2.png"; } sac.onmouseout=function(){ sac.src = "images/jd1.png"; } </script> </body> </html>
鼠标放上换图片
不会插入视频,如看效果麻烦点击下面链接。
https://pan.baidu.com/s/1jIqcw5K
原文:http://www.cnblogs.com/aria-h2o/p/6087550.html