Right now i am having this issue that i just can't seem to fix and the only better place than to look for how to fix this is stack overflow so here is the code HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="description" content="Hallo this is a game" />
<link rel="icon" href="images/SpongeBob_SquarePants_character.svg.png" />
<script src="index.js"></script>
<title>Javascript Game</title>
</head>
<body>
<script src="index.js"></script>
<label for="averynicebutton">Button</label>
<input type="checkbox" id="averynicebutton" /> <br />
<button id="submitButton">Submit</button>
</body>
</html>
again very simple code heres the javascript:
document.getElementById("averynicebutton").onclick = function(){
if(document.getElementById("averynicebutton").checked){
console.log("you clicked a button Woo-Hoo!")
}
}
Also heres a image for reference
so if you know how this problem occurred please tell me as i am very puzzled on how this happened as i am very new to javascript. Thank you for taking the time to read this. Bye Bye