私は入力があるテーブルを持っており、使用している入力のインデックスを取得しようとしています。例えば要素を見つけるJQueryがリストにあります
$(document).on('keyup', '.inputs input', function(event) {
var inputVal = $(this).val();
var inputListVal = $(this).parent('tr').index(this); <!-- This is the bit thas not working -->
console.log(inputListVal);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr>
<th><input type="text" name=""></th>
<th><input type="text" name=""></th>
<th><input type="text" name=""></th>
<!-- I want this index if they are typing init -->
<th><input type="text" name=""></th>
</tr>
</table>
は、すべての作業になりましたありがとうござい簡単な答えです –