0

I have problem because I would use my variable ejs in property name which is in input . I don't have idea how that do it .

<main> <h1> Witaj <%= login %> </h1> <ul> <% for(let sub of subject) { %> <li> <%=sub.sub %> <form method="POST" action="/change"> <input name="<%- sub.sub %>><input type="submit"> </form> <%=sub.rating %> </li> <% } %> </ul> 

I need receive in script.js variable "<%- sub.sub %>" . Please about help me .

1 Answer 1

1

You have a mistake in input declaration, try this instead

<form method="POST" action="/change"> <input name="<%- sub.sub %>" type="submit"> </form> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.