單擊按鈕我想獲取輸入字段的值。但是,我無(wú)法定位輸入字段,因?yàn)樽侄?id 是另一個(gè)組合值。我試過(guò)this.value這似乎只傳遞了 req.id 而不是輸入字段中輸入的值。我知道獲取輸入字段值的正確方法是: $(selector).val()但是,以下不適用于當(dāng)前的實(shí)現(xiàn)。 $(incidentNumber+${req.id}).val()<tr th:each="req : ${requests}"> <td><input th:id="incidentNumber+${req.id}" th:name="incidentNumber+${req.id}" style="width:100%" type="text" th:value="${req.incidentNumber}"><button th:value="${req.id}"class="button" type="button" onclick="validate_ticket_number(this.value)">Update</button></a></td></tr>我希望輸出是在“incidentNumber+${req.id}”輸入字段中輸入的值
如何定位具有使用 Thymeleaf 組成的 id 的輸入字段的值
喵喵時(shí)光機(jī)
2023-06-08 14:39:40