这是我破碎的意大利面条 JavaScript/jQuery 代码:
$(document).ready(function(){
var d = new Date;
var hours = Date.getHours();
var mins = Date.getMinutes();
if(hours > 12){
var hour = (hours - 12);
var ampm = "PM";
}
else{
var hour = hours;
var ampm = "AM";
}
var time = hour + ":" + mins, ampm
$("h1").html(time);
});
});
你能帮我做一个工作时钟吗?