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

234
Views
La función "onkeydown" no funciona en Brackets (editor de código) - Consola: "Error de tipo no detectado: no se pueden leer las propiedades de undefined (leyendo 'z')"

Cuando hago clic en las teclas de flecha, parece que la consola nota que se presionan las teclas pero no responde moviendo el objeto que quiero mover. Tiene un problema al leer "x" y "z". Por ejemplo, la consola indica: "TypeError no detectado: no se pueden leer las propiedades de undefined (leyendo 'x') en HTMLDocument.document.onkeydown".

Por favor revisa mi código:

 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Practice</title> <style> ... .purp { background-color: violet; width: 250px; text-align: center; padding: 5px; border: 5px solid aqua; float: left; } ... </style> <script> var purp = document.getElementsByClassName ("purp"); document.onkeydown = function (move) { if (move.keyCode == 37) { purp.position.x -= 1; } else if (move.keyCode == 39) { purp.position.x += 1; } else if (move.keyCode == 38) { purp.position.z -= 1; } else if (move.keyCode == 40) { purp.position.z += 1; } }; </script> </head> <body> ... <side-menu class='purp'> <div> <h2>ngfsndkgnsdkfng</h2> <p>fdkmgsdlfgmdflkggelkgdlfkmgdlkf</p> <p>dfgjdgorkgjeogmoggkmdlfkbmsdkgfmkfmgkggkn</p> </div> </side-menu> ... </body> </html>
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!