ページ上の複数の画像から JQuery 関数を呼び出そうとすると、問題が発生します。誰かが私を助けてくれたら、それは素晴らしいことです。
これは私のコードです:
HTML
<input type="image" name="rateButton[1]" src="img/Rate1.png" height="40" width="40" value="1" onclick="rateBox(1)"/>
<input type="image" name="rateButton[2]" src="img/Rate2.png" height="40" width="40" value="1" onclick="rateBox(2)"/>
<input type="image" name="rateButton[3]" src="img/Rate3.png" height="40" width="40" value="1" onclick="rateBox(3)"/>
<input type="image" name="rateButton[4]" src="img/Rate4.png" height="40" width="40" value="1" onclick="rateBox(4)"/>
<input type="image" name="rateButton[5]" src="img/Rate5.png" height="40" width="40" value="1" onclick="rateBox(5)"/>
<input type="image" name="rateButton[6]" src="img/Rate6.png" height="40" width="40" value="1" onclick="rateBox(6)"/>
<input type="image" name="rateButton[7]" src="img/Rate7.png" height="40" width="40" value="1" onclick="rateBox(7)"/>
<input type="image" name="rateButton[8]" src="img/Rate8.png" height="40" width="40" value="1" onclick="rateBox(8)"/>
<input type="image" name="rateButton[9]" src="img/Rate9.png" height="40" width="40" value="1" onclick="rateBox(9)"/>
<input type="image" name="rateButton[10]" src="img/Rate10.png" height="40" width="40" value="1" onclick="rateBox(10)"/><br>
JQuery
$(document).ready(function(){
function rateBox(rating){
// Ajax Call here...
}
});