htmlfile:
<!DOCTYPE html>
<head>
<script src="script.js"></script>
</head>
<body>
<div class="q" id="cooki" onclick="cookie()">Accept!</div>
</body>
js:
function cookie() {
alert("hi");
}
and I even tested with console.log, I used script source in body tags , nothing worked
>Solution :
Hi @Z3N1X Welcome to Stackoverflow.
To fix your issue try renaming your function to something else,
since like how @jabaa in the comment.
the cookie name is reserved in JS, So you can’ use it