<!DOCTYPE html>
<html>
<head>
<title>picture</title>
</head>
<body>
<button onclick="showPicture()" type="button" style="border: 1px solid #ffffff;padding: 0px;">
<img id="img1" src="pictures/heying0_1.png" width="600" height="450" align="right">
</button>
<script type="text/javascript">
function showPicture(){
if (typeof(Storage)!=="undefined") {
if (sessionStorage.clickcount) {
sessionStorage.clickcount=Number(sessionStorage.clickcount)+1;
}else{
sessionStorage.clickcount=1;
}
//document.getElementById("im").innerHTML="点击按钮 "+sessionStorage.clickcount+"次。";
document.getElementById("img1").src="pictures/heying0_"+String((sessionStorage.clickcount)%4+1)+".png";
}else{
//如果不支持web存储,设置一个默认的
document.getElementById("img1").src="pictures/heying0_1.png";
}
}
</script>
</body>
</html>