
function noticeTime(){
var dt = new Date();
var h = dt.getHours();
if ( h>= 10 && h<=16 ){
//执行你要做的事
}
}
二,调用,使用setTimeout,每分钟判断一次
var timeOut = setTimeout("notimeTime",1000*60);
这个是简单判断方式,它是每分钟会判断一次
var
date
=new
Date();
if(11==date.getHours()){
if(date.getMinutes()>=30){
alert("111");
}
}else
if(12==date.getHours()){
if(date.getMinutes()==0){
alert("111");
}
}
这个代码
应该可以解决你的问题
希望采纳!!