我有動態像這樣生成的表結構 -jquery:如何獲得父母<tr>使用其值?
<table>
<tr class="row">
<td class="order">1</td>
<td class="name">abc</td>
</tr>
<tr class="row">
<td class="order">2</td>
<td class="name">def</td>
</tr>
</table>
基本上我將具有值兩者rows.Using每個順序值的1,2,我將如何能夠獲得它的父和循環通過它並獲得它的價值?
我期待的輸出是使用順序值「1」,我必須得到「abc」並使用順序值「2」,我必須得到「def」。
任何人都可以幫我解決這個問題嗎?
你嘗試過什麼??? – Hiral
父母是TR,沒有價值,沒有任何其他元素? \t \t \t \t變種行= $(本).parent( 'TR'); $。每個(訂單,函數(指數,值){ \t \t \t \t變種ordervalue =值 - – adeneo
是的,我已經採用這種嘗試.find(「。name」)。html(); \t \t \t}); – user3121571