admin管理员组

文章数量:1023738

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>

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>

本文标签: javascriptDisplaying data inside textarea (ejs)Stack Overflow