I am looping a list and displaying each item in the list.
Each item in-turn can have a list and I need to loop them again and show. following is the code I am using,
<c:forEach var="i" items="${someThing.uList}">
<tr>
<td><input type="radio" name="thelist" value="${i.id}"/>${i.number}</td>
<td>${i.name}</td>
<td>${i.class}</td>
<td>${i.date}</td>
<c:if test="${not empty i.childs}">
<td><input type="button" value="+" id="link" onclick="showChilds('child');"/></td>
</c:if>
</tr>
<c:if test="${not empty i.childLoads}">
<tr id="child">
<c:forEach var="c" items="${i.childLoads}">
<td><input type="checkbox" name="thelists" value="${c.id}"/>${c.number}</td>
<td>${i.name}</td>
<td>${i.class}</td>
<td>${i.date}</td>
</c:forEach>
</tr>
</c:if>
</c:forEach>
When the page loads, I want to hide the second loop, given id as child, but only the first child is hidden all others are still showing. How to hide all the childs? I can create a unique id but how can I pass that to javascript to hide or show depending on user click event?