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

155
Views
¿Cómo hago para que las funciones se ejecuten dependiendo de si se hace clic en un botón determinado en Javascript?

Estoy trabajando para intentar que se ejecuten diferentes funciones si se hace clic en un botón determinado en el HTML. Cuando abro el sitio, se ejecuta y no hay errores en la consola, pero no sucede nada cuando hago clic en uno de los cuatro botones. Esto es lo que tengo ahora mismo:

 document.getElementById("answer-2").addEventListener("click", answers()); function answers() { if (document.getElementById("answer-2").clicked == true) { showQuestions2(); } else if (document.getElementById("answer-2").clicked == false) { timerPenalty(); } else if (seconds <= 0) { endGame(); } }
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!