Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
How can I make word blocks of text that go inside of <textarea>s?

In the website I am working on, I need there to be a <textarea> where the user can write a description, and add user-defined variables as shown below:screenshot of what I just described

When one of the buttons is clicked, it adds the corresponding text to the <textarea> above. Then, in the JS, I use the replaceAll() method to substitute the variables added with their corresponding values.

This works and all, but I would want to do is go for something that looks like this: variables acting like blocks instead of text

So I still want the block of text to function the same as before, but it would be sort of like one character, where if you hit the backspace on it it would delete the whole block. Is there a way I can go about doing this (using Vanilla JS)?

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can't render HTML in a textarea. What you'll need is a content editable DIV – here is some rough HTML & CSS.

<div contenteditable="true" >
  Hi, My Name Is BusinessName
</div>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda