본문 바로가기
개발자의 공부방/Front-End

JSTL selectbox 시간 분 나타내기 feat. option value 값도 함께

by 쌈빡한 쥬니준 2020. 7. 13.
<li class="form-group form-inblock">
<div class="select-box mw30p">
<select id="startTimeH" class="form-control w100 ml5">
<c:forEach var="hour" begin="0" end="23" >
<option value="<c:if test="${hour < 10}">0</c:if>${hour}"><c:if test="${hour < 10}">0</c:if>${hour}</option>
</c:forEach>
</select>
<span class="caret"></span>
</div>
<span></span>
<div class="select-box mw30p">
<select id="startTimeM" class="form-control w100 ml5">
<c:forEach var="min" begin="0" end="59" >
<option value="<c:if test="${min < 10}">0</c:if>${min}"><c:if test="${min < 10}">0</c:if>${min}</option>
</c:forEach>
</select>
<span class="caret"></span>
</div>
<span></span>
</li>

댓글0