<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="" alt="">
<script>
var img = document.querySelector("img");
var timer = new Date();
var h = timer.getHours();
if (6 <= h && h < 11) {
img.src = 'morning.gif'
} else if (11 <= h && h < 13) {
img.src = '1.gif'
} else if (13 <= h && 18 < h) {
img.src = 'afternoon.gif'
} else {
img.src = 'evening.gif'
}
</script>
</body>
</html>