For döngüsü ile yıllar

Bu örnekte iki ayrı döngü ile çift ve tek yılların sıralamasını görüyoruz.



<p>Tek Yıllar

<select name="select" id="select">

<% for i=1901 to 2010 step 2 %>

<option value="<%=i%>"><%=i%></option>

<% next %>

</select>

</p>

<p>Cift Yıllar

<select name="select2" id="select2">

<% for i=1900 to 2010 step 1 %>

<option value="<%=i%>"><%=i%></option>

<% next %>

</select>

</p>

Hiç yorum yok:

Yorum Gönder