0

我想循环遍历单击 $this 按钮的下一个表的每个 td

<input type="button" class='btn'>   
<table><tr><td></td></tr>......</table>   

<input type="button" class='btn'>   
<table><tr><td></td></tr>......</table>   

<input type="button" class='btn'>   
<table><tr><td></td></tr>......</table>   

<script type="text/javascript" src="jquery.js"></script>   
<script type="text/javascript">
    $()ready(function(){   
       $(".btn").click(function(){
          //loop through each td of next table??????
       });
    });
</script>
4

1 回答 1

4

尝试这个,

现场演示

 $(document).ready(function(){   
       $(".btn").click(function(){
          //loop through each td of next table??????
           $(this).next().find('td').each(function(){
            });
       });
 });
于 2012-09-21T16:53:41.940 回答