Página personal de Angel A. Martinez A.

Lunes, Abril 4/p>

MODULO 3: JAVASCRIPT: SENTENCIA, EXPRESIÓN, VARIABLE, FUNCIÓN, OBJETO Y DOM


Entrega P2P obligatoria Entrega.


Ampliar la siguiente aplicación Web (muestra la fecha y la hora):


           
			 <!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>
            
        



"Angel A. Martinez A."

La fecha y la hora son:





Contenido de innerHTML de elemento identificado por id="h2":


Contenido de outerHTML de elemento identificado por id="h1":


Contenido de de la propiedad global: location.href:


Contenido de de la propiedad global: location:


Contenido de de las propiedades globales screen.width y screen.heigth: