b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » XXX » Message 11185125 (Thread)

#
var data = [
[0, 11, 'morning'],
[12, 17, 'afternoon'],
[18, 24, 'night']
],
hr = new Date().getHours();

for(var i = 0; i < data.length; i++){
if(hr >= data[i][0] && hr < = data[i][1]){
document.write(data[i][2]);
}
}
(, Mon 25 Jan 2016, 11:12, archived)