如下:
function setType()
{
var hour = new Date().getHours();
if (hour<10) {
$('#dfMaster_出勤類別').selectoptions('setValue','上班');
}
else if (hour>9 && hour<17) {
$('#dfMaster_出勤類別').selectoptions('setValue','公出');
}
else if (hour>16 && hour<21) {
$('#dfMaster_出勤類別').selectoptions('setValue','下班');
}
}