如何使用选择器选择210.00
?
<tr class="order-total">
<th>Total</th>
<td data-title="Total">
<strong>
<span class="woocommerce-Price-amount amount">
<span class="woocommerce-Price-currencySymbol">$</span>
210.00
</span>
</strong>
</td>
</tr>
答案 0 :(得分:0)
只需尝试
<iron-selector attr-for-selected="name" multi selected-values='["foo","bar"]' selected-attribute="checked">
或
var allChildNodes = $("td[data-title='Total'] span").first()[0].childNodes;
var lastSpanNode = allChildNodes[ allChildNodes.length - 1 ];
通过
获取其价值var allChildNodes = $("td[data-title='Total']").find("span").first()[0].childNodes;
var lastSpanNode = allChildNodes[ allChildNodes.length - 1 ];
答案 1 :(得分:0)
试试这个
var device = RestService.For<IDevice>("http://localhost");
CancellationTokenSource tokenSource = new CancellationTokenSource();
tokenSource.CancelAfter(10000); // 10000 ms
CancellationToken token = tokenSource.Token;
var dev = await device.GetDevice("15e2a691-06df-4741-b26e-87e1eecc6bd7", "Bearer OAUTH_TOKEN", token);
答案 2 :(得分:0)
找出210.00
var total = $('tr.order-total td[data-title="Total"]').text().replace('$', '').trim();
console.log(total);
Woring URL:https://jsfiddle.net/mb7s24pb/