1/用jquery获取某个td相对于table的索引值:

<script type="text/javascript">
$(document).ready(function(){
$("table td").bind("click",function(){
var index = $(this).parent().index();
alert(index);//表示所在行的索引。如果要的是列的索引,把parent()去掉
});
});
</script>

相关文章:

  • 2022-12-23
  • 2021-08-25
  • 2022-02-28
  • 2022-01-15
  • 2021-08-08
  • 2021-07-03
  • 2021-04-20
猜你喜欢
  • 2021-07-21
  • 2021-07-08
  • 2021-07-11
  • 2021-05-23
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
相关资源
相似解决方案