这是我的 .js 文件中的内容:
function starClick1() {
document.getElementById=("RatingStars").src="../images/Stars1";
}
function starClick2() {
document.getElementById=("RatingStars").src="../images/Stars2";
}
function starClick3() {
document.getElementById=("RatingStars").src="../images/Stars3";
}
在 .html 文件中我放了这个:
<div id="RatingStars">
<img onmousemove="imageSwitch1()" onclick="starClick1()" onmouseout ="imageSwitchOut1()" id="star1" height="14px" src="../images/starWhite.png">
<img onmousemove="imageSwitch2()" onclick="starClick2()" onmouseout ="imageSwitchOut2()" id="star2" height="14px" src="../images/starWhite.png">
<img onmousemove="imageSwitch3()" onclick="starClick3()" onmouseout ="imageSwitchOut3()" id="star3" height="14px" src="../images/starWhite.png">
</div>
PS:其他功能与我的问题没有任何关系(我认为)。