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

174
Views
El texto de Javascript se reemplaza de la misma manera que el juego "Emiliy is away". Problema de encendido

Estoy haciendo un proyecto web de arte en el que quiero reemplazar el texto ingresado por el usuario con mis propias frases en infnity.

De manera similar como en el juego "Emily está fuera", pero esa será solo una frase repetida en el infinito.

Algo así: "texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. texto. . texto"

Cuando el usuario esté escribiendo, el resultado será siempre la misma frase.

Mi código se ve de esta manera:

 function myFunction() { result.innerHTML = "TEXT"; }
 <input type="text" onkeydown="myFunction()"> <div id="result"></div>

Estaré muy contento de ayudar.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

 let myInput = document.querySelectorAll('input'); myInput.forEach(input => { input.addEventListener('keydown', function() { result.innerHTML += "TEXT "; }); })
 <input type="text"> <div id="result"></div>

about 4 years ago · Juan Pablo Isaza Report

0

¿Es esto lo que quieres decir? Agregará la cadena a la salida existente, en lugar de reemplazarla:

 function myFunction() { result.innerHTML += "TEXT "; }
 <input type="text" onkeydown="myFunction()"> <div id="result"></div>

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!