遍历图片集合,当鼠标悬停在图片上弹出文字,但只是第一条有用,其他没有效果,这是怎么回事
代码:
<script type="text/javascript">
$(function(){
$("#img_1").hover(function(){
$("#span").html("删 除");
},function(){
$("#span").html("");
});
)};
<c:forEach items="${listProduct}" var="lp">
<td id="img_1" >
<span id="span"></span>
<a href="">
<img src="${pageContext.request.contextPath}/${lp.image}" style="width: 50px;height: 40px"/>
</a>
</td>
<c:forEach>