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

183
Views
Cómo activar el botón en el archivo html cuando se cumple la condición de declaración en el archivo .js

He jugado un poco con este código que esencialmente presiona automáticamente el botón de reinicio en el archivo html cuando la palabra se adivina correctamente, pero no puedo hacer que funcione, la identificación del botón se reinicia. Es un juego de adivinanzas, quiero que se reinicie automáticamente cuando se adivine la palabra. Los dos scripts $ son mi intento de hacer que esto funcione

 get statusMessage() { if (this.status === 'playing'){ return `Nice try! The word was "${this.word.join('')}"` return `Guesses left: ${this.remainingGuesses}` } else if (this.status === 'failed') { streak.innerHTML = 0 return `Nice try! The word was "${this.word.join('')}"``` } else { streak.innerHTML ++ return 'Great work! You guessed the word!' $('#reset').trigger('click'); $('#reset').click(); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

$('#restablecer').clic(); funcionará si lo escribe antes de una declaración de devolución como esta:

 else { streak.innerHTML ++ $('#reset').click(); return 'Great work! You guessed the word!' }
about 4 years ago · Juan Pablo Isaza Report
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!