admin管理员组文章数量:1433468
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
1 Answer
Reset to default 6This should work:
<textarea id="yourTextArea"><%= text %></textarea>
本文标签: javascriptDisplaying data inside textarea (ejs)Stack Overflow
版权声明:本文标题:javascript - Displaying data inside textarea (ejs) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745604838a2665779.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论