我想要的代码,当我从这种图像变化的图像上单击src到其他src.But我doesen't工作能有人HLP我的JavaScript上点击图片src变化
<?php require_once("php/config.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title> test </title>
<script type="text/javascript" src="javascript/liabary.js"></script>
</head>
<body>
<img id="img" onclick="next()" src="img/bildergalerie/bild3.jpg" id="b3" width="1000" height="500" alt="image" />
<script type="text/javascript">
function next() {
var img = document.getElementByIdName("img");
img.src = "image2.jpg";
}
</script>
</body>
</html>
PS:对不起我的英文不好,我还是学生。
PPS:现在它的工作的帮助表示感谢
'IMG [0]的.src'........ –