私は何をしているのか分かりません...私は2つのパラメータを持つ関数を使用して画像を変更し、 'kendal' 3番目の行と4番目の行の '書き込み'のテキストを別の画像をクリックすると何かに変更....誰かが何か間違って見ますか?2つのパラメータを使用して画像とテキストを変更する必要があります
</style>
<script>
function changes(newMessage, imageName)
{
var elementToUpdate = document.getElementById("writing")
elementToUpdate.innerHTML = newMessage
var toChange = document.getElementById("kendal")
toChange.src = imageName
}
</script>
</head>
<body>
<form name="tform" id="tform">
<table id="table" name="table" border="1">
<tbody id="tablebody" name="tablebody">
<tr id="firstrow" name="firstrow">
<th id="header1" name="header1" colspan="5">Click on Image to
Enlarge</th>
</tr>
<tr id="secondrow" name="secondrow">
<td id="svu" name="svu">
<input type="image"
src="svu-tNail.jpg"
alt="Law Order SVU"
name="svupic" id="svupic"
onclick="changes('svu.jpg, Saint Leo Graduation 2016')">
</td>
<td id="ocean" name="ocean">
<input type="image"
src="ocean-tNail.jpg"
alt="Ocean"
name="oceanpic" id="oceanpic"
onclick="displayMessage('Bachelors degrees in Sport Business and
Business Management')"
onclick="changeImage('oecan.jpg')">
</td>
<td id="pizza" name="pizza">
<input type="image"
src="pizza-tNail.jpg"
alt="Pizza"
name="pizzapic" id="pizzapic"
onclick="displayMessage('Minor in Hospitality')"
onclick="changeImage('pizza.jpg')">
</td>
<td id="sunflower" name="sunflower">
<input type="image"
src="sunflower-tNail.jpg"
alt="Sunflower"
name="sunflowerpic" id="sunflowerpic"
onclick="displayMessage('Taken after receiving my diploma!')"
onclick="changeImage('sunflower.jpg')">
</td>
<td id="softball" name="softball">
<input type="image"
src="softball-tNail.jpg"
alt="Softball"
name="softballpic" id="softballpic"
onclick="displayMessage('Graduation was on April 30, 2016 in Saint Leo,
Florida')"
onclick="changeImage('softball.jpg')">
</td>
</tr>
<tr id="thirdrow" name="thirdrow">
<th id="kendal" name="kendal" colspan="5">
<input type="image"
src="kendal.jpg"
alt="Kendal LeFrancois"
height="750px" width="750px"
name="kendalpic" id="kendalpic"></th>
</tr>
<tr id="fourthrow" name="fourthrow">
<th id="writing" name="writing" colspan="5">Kendal LeFrancois</th>
</tr>
</tbody>
</table>
</form>
</body>
</html>