<html>
<body>
<script>
function changeImage(){
element=document.getElementById('myimage')//类似于id
if (element.src.match("big")){//检测图片类型
element.src="small.png";
}else{
element.src="big.png";
}
}
</script>
<img id="myimage" οnclick="changeImage()" src="small.png">
</body>
<body>
<script>
function changeImage(){
element=document.getElementById('myimage')//类似于id
if (element.src.match("big")){//检测图片类型
element.src="small.png";
}else{
element.src="big.png";
}
}
</script>
<img id="myimage" οnclick="changeImage()" src="small.png">
</body>
</html>