I recently started using ejs and encountered an issue with my input tag:
<input class="form-control" id="inputName" type="text" <% { %>value='<%= JSON.stringify(result.firstname) %>'<% } %>
When I try to print the data, it shows up empty.
However, when I change the value to:
<input class="form-control" id="inputName" type="text" <% { %>value='<%= JSON.stringify(result) %>'<% } %>
It displays the entire JSON data like this:
[{"userid":526,"firstname":"asdw","lastname":null,"username":"aasdasd","password":"sadadsadsadasda","email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="620311060311044c0f220311064c010d0f">[email protected]</a>","contact":null}]
What mistake am I making here?