javascript - Displaying data inside textarea (ejs) - Stack Overflow

admin2025-04-26  1

I'm trying to get data (taken from mongo) to display into a textarea. It's purpose is so that I can edit data within the database without actually touching the database itself. I can display the data within normal HTML tags but I'm pretty clueless on how to get it to display it within a textarea (or any other tags that allow me to edit and re-submit the new data)

I'm rendering with EJS, and so far, everything display correctly with

<%= text %>

I just need it to work within a editable text area

I'm trying to get data (taken from mongo) to display into a textarea. It's purpose is so that I can edit data within the database without actually touching the database itself. I can display the data within normal HTML tags but I'm pretty clueless on how to get it to display it within a textarea (or any other tags that allow me to edit and re-submit the new data)

I'm rendering with EJS, and so far, everything display correctly with

<%= text %>

I just need it to work within a editable text area

Share Improve this question edited Oct 28, 2017 at 22:14 Neil Lunn 151k36 gold badges356 silver badges325 bronze badges asked Oct 28, 2017 at 22:11 Justin LiJustin Li 914 silver badges11 bronze badges 1
  • Please show what you have so far – Code-Apprentice Commented Oct 28, 2017 at 22:26
Add a ment  | 

1 Answer 1

Reset to default 6

This should work:

<textarea id="yourTextArea"><%= text %></textarea>
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745604840a309521.html

最新回复(0)