点击切换图片

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function change(){
				var p1=document.getElementById("puture1")
				p1.src="img/5.jpg"
			}
		</script>
	</head>
	<body>
		<img src="img/4.jpg" id="puture1" width="70%"/>
		<input type="button" value="点击我切换图片" onclick="change()"/>
	</body>
</html>

图片要自己弄

猜你喜欢

转载自blog.csdn.net/abc1498880402/article/details/82989160