我想遍历一个表的每个td,这是$ this按钮的下一个点击
<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>
答案 0 :(得分:4)
试试这个,
<强> Live Demo 强>
$(document).ready(function(){
$(".btn").click(function(){
//loop through each td of next table??????
$(this).next().find('td').each(function(){
});
});
});