En este momento tengo este problema que parece que no puedo solucionar y el único lugar mejor que buscar cómo solucionarlo es el desbordamiento de pila, así que aquí está el código 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>de nuevo, un código muy simple aquí está el javascript:
document.getElementById("averynicebutton").onclick = function(){ if(document.getElementById("averynicebutton").checked){ console.log("you clicked a button Woo-Hoo!") } }También aquí hay una imagen para referencia.
Entonces, si sabe cómo ocurrió este problema, dígame, ya que estoy muy desconcertado sobre cómo sucedió esto, ya que soy muy nuevo en JavaScript. Gracias por tomarse el tiempo de leer esto. Adiós