time.html代码: 复制代码 代码如下: Document time.js代码: 复制代码 代码如下: function add_num(a,b,c){ if(cc++; } else{ c=b; } if(c=0){ c="0"+c; } return c; } function sub_num(a,b,c){ if(c>a){ c--; } else{ c=b; } if(c=0){ c="0"+c; } return c; } function add_hour(){ var current_num=$("#hour").attr("value"); current_num=add_num(23,0,current_num); $("#hour").attr("value",current_num); } function sub_hour(){ var current_num=$("#hour").attr("value"); current_num=sub_num(0,23,current_num); $("#hour").attr("value",current_num); } function add_minute(){ var current_num=$("#minute").attr("value"); current_num=add_num(59,0,current_num); $("#minute").attr("value",current_num); } function sub_minute(){ var current_num=$("#minute").attr("value"); current_num=sub_num(0,59,current_num); $("#minute").attr("value",current_num); }