-4

我有下表

<thead>

<tr>

<th>Account ID</th>

<th>Code</th>

<th>Date Created</th>

<th>Date Expires</th>

<th>Balance</th>

<th>Approve</th>

<th>Deny</th>

</tr>

</thead>

<tbody>

<tr class="test">

<td class="giftcardaccount_id"><span>35083</span>

</td>

<td class="code"><span>xxxxxxxxx</span>

</td>

<td><span>2012-06-28</span>

</td>

<td><span>2012-06-28</span>

</td>

<td><span>9.0000</span>

</td>

<td><Button id="approval_0" type="submit" class="save-button btn success floatRight" ><span>Approve</span> </button>

</td>

<td><Button id="deny_0" type="submit" class="save-button btn danger floatRight" ><span>Deny</span> </button>

</td>

</tr>

<tr class="test">

<td class="giftcardaccount_id"><span>35084</span>

</td>

<td class="code"><span>xxxxxxxx</span>

</td>

<td><span>2012-06-28</span>

</td>

<td><span>2012-06-28</span>

</td>

<td><span>9.0000</span>

</td>

<td><Button id="approval_1" type="submit" class="save-button btn success floatRight" ><span>Approve</span> </button>

</td>

<td><Button id="deny_1" type="submit" class="save-button btn danger floatRight" ><span>Deny</span> </button>

</td>

</tr>

</tbody>

我想要做的是,如果有人点击批准,我想获取所有行数据,以及点击批准按钮的信息。与拒绝按钮相同。我将如何使用 jquery 来做到这一点。

谢谢

**EDIT**
did this but not sure how to get the button that was clicked. I can get the data by this, but I dont know if the deny was clicked or submit was?

$('.test').click(function() {

    var id = $(this).children('.giftcardaccount_id').text();


});
4

1 回答 1

1
$('.test').click(function() {
    var id = $(this).find('.giftcardaccount_id:first > span').text();
});
于 2012-06-28T22:32:54.340 回答