SALUDAR AL VISITANTE DEPENDIENDO LA HORA (BUEN DÍA-BUENAS TARDES-BUENAS NOCHES)
Tener cortesía a la hora de saludar es muy importante, ya que la sociedad está presta a recibirla con agrado y saber que siempre existe amabilidad por tu parte es ¡grandioso! En este articulo hoy te voy a indicar los pasos para ingresar el código HTML para saludar al visitante dependiendo de la hora, es decir, Buen día, buenas tardes o buenas noches.
1. Debes copiar el siguiente código html:
<center><span style="font-size: large;"><span class="Apple-style-span" style="color: red;"><script language="JavaScript" type="text/javascript">
//<![CDATA[
<!--
today = new Date()
if(today.getMinutes() < 10){
pad = "0"}
else
pad = "";
document.write ;if((today.getHours() >=6) && (today.getHours() <=9)){
document.write("¡Buen día!")
}
if((today.getHours() >=10) && (today.getHours() <=11)){
document.write("¡Buen día!")
}
if((today.getHours() >=12) && (today.getHours() <=19)){
document.write("¡Buenas tardes!")
}
if((today.getHours() >=20) && (today.getHours() <=23)){
document.write("¡Buenas noches!")
}
if((today.getHours() >=0) && (today.getHours() <=3)){
document.write("¡Buenas noches!")
}
if((today.getHours() >=4) && (today.getHours() <=5)){
document.write("¡Buenas noches!")
}
// -->
//]]>
</script></span></span></center>
2. ir a tu website o blog y copiarlo en código html/javascript y listo! (ver imagen 1 y 2)
imagen 1.
Imagen 2.
No hay comentarios:
Publicar un comentario