-1
我需要幫助!如何獲得點擊按鈕的類(索引)序列號
HTML
<input type="button" onclick="myFunction()" class="myButton" value="Button1">
<input type="button" onclick="myFunction()" class="myButton" value="Button2">
<input type="button" onclick="myFunction()" class="myButton" value="Button3">
<input type="button" onclick="myFunction()" class="myButton" value="Button4">
JS:功能myFunction的(){ VAR鍵= document.getElementsByClassName( 「myButton的」); var index; (var i = 0; i