var ho new Date var hours ho getHours function thisday var hr select n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var ho = new Date();
var hours = ho.getHours() + 1;
function thisday(h){
var hr = "<select name=\"time\">";
for(var i=h;i<=22;i++){
hr += "<option value=\"" + i + "\">" + i + "</option>";
}
hr += "</select>";
return hr;
}
function nextday(){
var hr = "<select name=\"time\">";
for(var i=9;i<=22;i++){
hr += "<option value=\"" + i + "\">" + i + "</option>";
}
hr += "</select>";
return hr;
}
function nextday2(){
var hr = "<select name=\"time\">";
for(var i=9;i<=22;i++){
hr += "<option value=\"" + i + "\">" + i + "</option>";
}
hr += "</select>";
return hr;
}
jQuery
$(document).ready(function(){
$("#thisday").click(function(){
$("#hours").html(thisday(hours));
});
$("#nextday").click(function(){
$("#hours").html(nextday());
});
$("#nextday2").click(function(){
$("#hours").html(nextday2());
});
});
HTML
<tr>
<td>День:</td>
<td><select name="day"><option value="сегодня" id="thisday">Сегодня</option><option value="завтра" id="nextday">Завтра</option><option value="послезавтра" id="nextday2">Послезавтра</option></select></td>
</tr>
<tr>
<td>Время:</td>
<td id="hours"><script language="javascript" type="text/javascript">$("#hours").html(thisday(hours));</script></td>
</tr>