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

168
Views
¿Cómo verifica si el usuario escribió la palabra específica dentro de un área de texto?

¿Cómo verifica si el usuario escribió el texto específico dentro de la etiqueta del área de texto? Aquí hay un ejemplo

 </head> <body> <textarea> </textarea> <div class="box"> </div> <script> (this is just example) if = user typed inside textarea this =("display (hi)") do = build element inside .box the user typed inside the () of the text "display" </script>

Realmente no sé cómo hacerlo, trato de buscarlo, pero no apareció ninguno y si está confundido con el código, simplemente falló

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

0

Con la función de cadena JS que includes , puede archivar esto.

 let block = false; const box = document.querySelector('.box'); function check(e) { const match = e.value.includes("hi"); if (match && block === false) { box.innerHTML = 'Hello again' block = true; } }
 <textarea onkeyup="check(this)"></textarea> <div class="box"></div>

about 4 years ago · Juan Pablo Isaza Report

0

Espero que te de una idea. Si usa, escriba cualquier texto e incluya hola en el área de texto. Se mostrará todo el texto en el contenedor de la caja.

 let textarea = document.querySelector("textarea"); let box = document.querySelector('.box'); textarea.addEventListener('keyup', (e) => { if (e.target.value.includes("hi")){ box.innerHTML = ""; box.append(`${e.target.value}`); } })
 <textarea></textarea> <div class="box"></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!