我認爲是一個簡單的問題,但我遇到了一些問題。選擇裏面的文本<b></b>標籤
我需要得到<b></b>
之間的值,是一個TBODY,TR和TD的內部。
下面是HTML
<table class="table table-bordered table-striped">
<tbody class="connectedSortable" id="[email protected]">
<tr>
<td align="center">
<b>@year.Year</b>
</td>
</tr>
</tbody>
</table>
我jQuery是以下幾點:
$("#table-draggable-2 > tr:first > td > b")
而作爲一個結果我得到:
[<b>2017</b>]
但我需要的只是2017年的價值。我錯過了什麼?
的可能的複製[jQuery的獲取文本(http://stackoverflow.com/questions/4705474/jquery-get-text) –