从jstl foreach调用一个Javascript函数



我正在JSTL中迭代列表以显示其记录。每个<form:label上都有一个onclick="editList()"事件。如果点击了editList()函数参数中的任何一个,我想发送${item.id}${item.number}。如何发送这些参数

<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}')"

最新更新