<img id="img1" src="images/loginImages/left.png" onclick="document.getElementById('img1').value='images/loginImages/right.png'"/>
我是这么写的。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function change() {
document.getElementById("img1").src = "2.gif";
}
</script>
</head>
<body>
<img id="img1" src="1.gif" alt="" onclick="return change()" />
</body>
</html>