我有一個下面的代碼。它是一個基於$ {listStores}輸出的動態表。每行在最後一個單元格上都有一個編輯按鈕。點擊它我想獲得StoreId這是一個隱藏的元素對該行相應的行。從包含編輯按鈕的行獲取元素值
<tbody>
<c:forEach items="${listOpenStores}" var="store">
<tr>
<td class="collapsing">
<div class="ui fitted checkbox">
<input type="checkbox"> <label></label>
</div>
</td>
<td id="at-liststore-storeid-hidden" >
<div class="ui input">
<input type="text" value="${store.storeId}">
</div>
</td>
<td>${store.storeName}</td>
<td>${store.storeURL}</td>
<td>
<div id="at-store-edit-btn" class="ui primary icon button"><i class="pencil icon"></i></div>
</td>
</tr>
</c:forEach>
</tbody>
你試圖解決這個自己?你走多遠了?告訴我們你的代碼。 – PeterKA
ID **必須**在文檔上下文中是唯一的。您呈現的HTML標記無效$ –
我嘗試使用var elem = $(this).parent()。parent();但不能通過 –