Why is my onload event in Javascript not working
This code is not displaying anything on the p tag as it suppose to do. <!DOCTYPE html> <html> <body id="myBody"> <h1>HTML DOM Events</h1> <h2>The onload Event</h2> <p id="demo"></p> <script> document.getElementById("myBody").addEventListener("load", checkCookies); function checkCookies() { var text = "This page "; if (navigator.cookieEnabled == true) { text = "Cookies are enabled."; } else { text =… Read More Why is my onload event in Javascript not working