我正在使用jstl。在我的页面中有一个循环,它创建具有不同ID的div,但我已经看到有一些div(循环完成后)具有相同的id(div)我想删除或说想要阻止它们被创建。我想通过jstl在循环内部实现它。请帮忙。
请找到代码段 -
<c:forEach var="menuType" items="${menuTypes}" begin="0" varStatus="mCount">
<c:set var="mcnt" value="${mCount.count}"></c:set>
<div class="window" id="window${mcnt}" onmouseout="hideBub('${mcnt}');" style="top:${mcnt*200}px">
<div id="inner-cont${mcnt}" class="inner-cont" align="center" onmouseover="showBubble('${mcnt}');">
${menuType.functionName}(<span id="totRecord"></span>)
<div class="bubble" id="bubble${mcnt}" style="margin-left:50px;" onmouseout="hideBub('${mcnt}');">
<a href="#">
<span>[+] Add New
</span>
</a>
<hr>
<div class="box">
<div class="box-content">
<table width="100%" class="hovertable">
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="dispRec${mcnt}" class="dispRec"></div>
</div>
<div align="center" class="btnContainer" style="width:90px;">
<span class="linkButton"><a href="#" style="color:white;text-decoration: none;">View</a></span>
<span class="linkButton"><a href="#" style="color:white;text-decoration: none;">Edit</a></span>
<span class="linkButton"><a href="#" style="color:white;text-decoration: none;">Delete</a></span>
</div>
<div align="center" class="btnContainer" style="width:47px;float: right">
<span class="linkButton" style="display: inline-block;padding: 1px;margin-right: 2px">
<a href="#" style="color:white;text-decoration: none;">Analysis</a>
</span>
</div>
</div>
</c:forEach>
</div>