当鼠标经过换一张相片

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>当鼠标经过换一张相片</title>
    <meta name="keywords" content="关键字列表" />
    <meta name="description" content="网页描述" />
    <link rel="stylesheet" type="text/css" href="" />
    <style type="text/css"></style>
    <script type="text/javascript"></script>
</head>
<body>

</body>
</html>
    <img src="jd1.png" id="img1">    
    <script type="text/javascript">
        var imgObj=document.getElementById("img1");//对象.属性=(""),对象.方法("")
        imgObj.onmouseover=function(){
        imgObj.src="jd2.png"                    
        }
        imgObj.onmouseout=function(){
        imgObj.src="jd1.png"                
        }
      
    </script>

 

posted on 2016-11-22 09:04  91xiaozhu  阅读(127)  评论(1编辑  收藏  举报