Contenido de innertHTML de elemento identificado por id "h2"
document.getElementById("h2").innerHTML = La fecha y la hora son:
Contenido de outertHTML de elemento identificado por id "h1"
escapeHtml(document.getElementById("h1").outerHTML) = < h1 id="h1" >Buenas noches <br> Entrega de Chelsea Peña </h1>
Contenido de de la propiedad global: location.href
location.href = https://chelseaxiomara99.neocities.org/date.html
Contenido de la propiedad global:location
Object.getOwnPropertyNames(location) = https: //chelseaxiomara99.neocities.org/date.html
Contenido de de las propiedades globales: screen.width y screen.heigth
screen.width = 1366 screen.height= 768
<!DOCTYPE html><html>
<head>
<title>Date</title>
<meta charset="UTF-8">
</head>
<body>
<h1 id="h1"></h1>
<h2 id="h2">La fecha y la hora son:</h2>
<div id="fecha"></div>
<script type="text/javascript">
var fecha = new Date();
var msj;
if (fecha.getHours() < 7) { msj = "Buenas noches";}
else if (fecha.getHours() < 12) { msj = "Buenos días";}
else if (fecha.getHours() < 21) { msj = "Buenas tardes";}
else { msj = "Buenas noches";}
document.getElementById("h1").innerHTML = msj;
document.getElementById("fecha").innerHTML = fecha;
</script>
</body>
</html>