代码:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script> function changeImg() { var img = document.getElementById("img1"); img.src = "https://i03piccdn.sogoucdn.com/1ce429cb207df745"; } </script> </head> <body> <input type="button" value="点击切换图片" onclick="changeImg()"/> <br/> <img src="https://i01piccdn.sogoucdn.com/d5d909ee8ce5249d" id="img1"/> </body> </html>