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>