最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin4PV0评论

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>
Post a comment

comment list (0)

  1. No comments so far