我想,當用戶點擊一個排jQuery的如何獲得TD手機價值
下面任意位置即可發票號碼的價值是我的表
<div class="panel ui-widget-content" id="invoiceList">
<h2 class="ui-widget-header ui-corner-top" style="cursor: pointer; "><span>Invoices</span></h2>
<table cellspacing='0' id='header' class="ui-widget">
<tr>
<th>Invoice Number</th>
<th>Invoice Total</th>
</tr>
<tr>
<td><a href="#" >INV-Error_Test1</a></td>
<td>22.000000 USD</td>
</tr>
<tr>
<td><a href="#" >INV-Error_Test2</a></td>
<td>22.000000 USD</td>
</tr>
</table>
</div>
下面是jQuery的我有這給只有當它的點擊Invoice Number
領域的發票編號
$("#invoiceList td").click(function (e) {
var result = $(this).text();
console.log('invoice --->'+result);
});
有人可以幫助我獲得發票號碼,當用戶點擊行中的任何地方時。
的最後一個孩子是總。發票號碼是第一個孩子。 – Barmar 2015-04-03 22:29:56
謝謝,我錯過了他想要發票號碼 – Charkan 2015-04-03 22:31:41