我正在迭代 JSTL 中的列表以显示其记录。有onclick="editList()"
每个 <form:label
上的事件。我想同时发送${item.id}
和${item.number}
在 editList()
函数参数(如果单击其中任何一个)。我如何发送这些参数。
<c:forEach var='item' items='${rule.list}' varStatus="itemsRow">
<tr>
<form:label path="list[${itemsRow.index}].id" onclick="editList()">
${item.id}
</form:label>
</tr>
<tr>
<form:label path="list[${itemsRow.index}].number" onclick="editList()">
${item.number}
</form:label>
</tr>
</c:forEach>
最佳答案
onclick="editList('${item.id}', '${item.number}')"
关于javascript - 从 jSTL foreach 调用 Javascript 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7090230/