Santiago Sotelo Docío

La fecha y la hora son:




    SCRIPT:
    
    var fecha = new Date();
    var msj;
    var contenido = document.getElementById("tarea");

    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;

    contenido.innerHTML = "<br/><u>Propiedad innerHTML id h2</u>: " + "<i>\"" + document.getElementById("h2").innerHTML + "\"</i>";
    contenido.innerHTML += "<br/><u>Propiedad outerHTML id h1</u>: " + "<i>" + document.getElementById("h1").outerHTML + "</i>";
    contenido.innerHTML += "<br/><u>Propiedad global location.href</u>: " + "<i>\"" + document.location.href + "\"</i>"; 
    contenido.innerHTML += "<br/><u>Propiedad global location</u>: " + "<i>\"" + document.location + "\"</i>";
    contenido.innerHTML += "<br/><u>Propiedades globales screen.width y screen.height</u>: " + "<i>\"" + screen.width + "*" + screen.height +"\"</i>";


Inicio