如何获取c:forEach里面点击时候的值

it2025-12-22  12

1.c:forEach遍历输出

<c:forEach items="${data}" var="item" >   <a οnclick="downfile(this)" id="${item.filename}" plain="true"><h1>${item.filename}</h1></a><br/> </c:forEach>

2.获取点击的function

function downfile(e){   var id = $(e).attr("id");

  alert(id);

}

转载于:https://www.cnblogs.com/hl-spring/p/8108685.html

最新回复(0)