首页 > 代码库 > c:foreach 标签 varStatus的使用

c:foreach 标签 varStatus的使用

                <c:forEach items="${MedicalDoctoList }" var="medicalDoctor" varStatus="status">
                    <tr>
                        <td><input style="width: 170px" id="name${status.index+1}" name="name" required="required" value="http://www.mamicode.com/${medicalDoctor.name }"/></td>
    
                        <td><input style="width: 170px" id="phone${status.index+1}" name="phone" required="required" value="http://www.mamicode.com/${medicalDoctor.phone }"/></td>
                        
                        <td hidden="hidden"><input style="width: 170px" id="doctorIds" name="doctorIds" required="required" value="http://www.mamicode.com/${medicalDoctor.doctorId }" style="display:none;"/></td>
    
                        <td> <input type="button" value="http://www.mamicode.com/删除" style="width: 80px"
                            onclick="delDoctorTr(${status.index+1})" />
                        </td>
                    </tr>
                </c:forEach>

 

c:foreach 标签 varStatus的使用