通过document.getElementById("pic").src="pattern.png";
来修改照片的来源即可
<html>
<body>
<input type="button" value = "切换图片" οnclick="changepic()"/>
<img id= "pic" src="ss1.jpg" />
<script>
function changepic()
{
document.getElementById("pic").src="pattern.png";
}
</script>
</body>
</html>