在循环中设置点击事件

<c:forEach var="a" begin="1" end="5">
<button value="${a}" onclick="dian(this)">1</button>
</c:forEach>
<script>
function dian(a) {
alert($(a).val())
}
</script>
posted @ 2019-07-15 21:00  若久  阅读(711)  评论(0编辑  收藏  举报