samedi 30 mai 2020

IF Statement won't Execute With Date().getHours() [closed]

not sure why this isn't executing

function get_Date(){
    if (new Date().getHours() < 12) {
        document.getElementById("date") .innerHTML + "Have a nice day";
    }
}
<p id="date" onclick="get_Date()">click here.</p>

Aucun commentaire:

Enregistrer un commentaire