<html>
<body onload="checkCookies()">
<h1>JavaScript HTML Events</h1>
<h2>The onload Attribute</h2>
<p id="demo"></p>
<script>
function checkCookies() {
let text = "";
if (navigator.cookieEnabled == true) {
text = "Cookies are enabled.";
} else {
text = "Cookies are not enabled.";
}
document.getElementById("demo").innerHTML = text;
}
</script>
</body>
</html>