JavaScript DOM操作案例点击图片在下面显示大图

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<a href="../images/1.jpg" id="ak"><img src="../images/1-small.jpg" alt=""/></a>
<img src="" alt="" id="big"/>
<script src="common.js"></script>
<script>
    my$("ak").onclick = function () {
        my$("big").src = this.href;
        return false;
    };
</script>
</body>
</html>

 

posted @ 2018-07-22 17:30  {颜逸}  阅读(391)  评论(0编辑  收藏  举报