Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
TypeError no capturado: no se pueden establecer propiedades de nulo (estableciendo 'onclick')

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!