<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <button id="up">上一张</button> <button id="below">下一张</button> <img id="img" src="../img/cat_five.jpg" /> <script> var ups =document.getElementById('up'); var belows=document.getElementById('below'); var srcs = document.getElementById('img'); ups.onclick = function(){ img.src='../img/man-1.jpg'; } belows.onclick =function(){ img.src='../img/cat_five.jpg' } </script> </body> </html>