It's April 30th, which means that, tomorrow, yes, it's gonna be May. (It also means I have to update my blog's home page, because breaking everything into months is a slightly manual process, but I like that it's a manual process, dammit. I also like making bad *NSync jokes. IT'S GONNA BE MAY.) The JavaScript If Statementif is pretty straightforward. But the examples did show me that if I'm using getElementById, I can put things into the original HTML element. The other tutorial made it seem like I couldn't, because it wasn't working if I had a space in there, but maybe that was just something about it not being right, because it works a treat here: <p id="demo">Good Evening!</p> <script> if (new Date().getHours() < 18) { document.getElementById("demo").innerHTML = "Good day!"; } </script> That means, of course, it's time for: <p id="demo">PREPARE YOURSELF!</p> <script> let mood1 = "cattle"; let mood2 = "loveplay"; if (mood1 == "cattle") { document.getElementById("demo").innerHTML =…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.