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

153
Views
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 answers
Answer question

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 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!