jQuery 获取遍历获取table中每一个tr中的第一个td

时间:2024-10-21 07:35:01
<tbody >
	<tr>
		<td><?php echo $val['unique_number']; ?></td>
		<td><?php echo $val['year'].'-'.$val['series']; ?></td>
		<td><?php echo $val['content'] ?></td>
		<td><?php echo $val['knowledges'] ?></td>
		<td><?php echo $val['last_admin']; ?></td>
		<td>
			<input type="button" class="btn" value="-" data-score="<?php echo $val['score']; ?>" οnclick='remove_selected(this);'/>\
			<input type="hidden" name="question_numbers[]"  value="<?php echo $val['unique_number']; ?>"/>
		</td>
	</tr>
</tbody>

<script>
	var leng = $("#already_question_list tr").length;
	var filter_numbs = new Array();
	for(var i=0; i<=leng; i++)
	{
		numberStr = $("#already_question_list tr").eq(i).find("td:first").html();
		filter_numbs.push(numberStr);
	}
</script>