简体   繁体   中英

Displaying data from the console into an HTML form using EJS

So, I'm building an app where the user enters some data, the code modifies it, and returns it back to the user on the screen in an HTML input tag probably.

The user input is taken as : const userInput = req.body.user_word; (using Node.js for backend)

and the modified data is stored as var encrypted_word

I wish to display the contents of this variable into an input tag <input type="text" name="encrypted_word"> using EJS

I read that <%= tag is helpful in doing so but couldn't devise the solution.

Can someone help me with this...

我会使用<%-而不是<%=你也必须输入属性value

<input type="text" value="<%- encrypted_word %>">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM