-3

i have been trying to add a variable into the html input tag but its giving error

<% String x = "amol"; %>
<input type="button" name="test" value="Edit" id="<%=x%>"/>

this is giving error . please suggest

error --> cannot enter white space in ID tool --> Netbeans IDE

amol
  • 87
  • 1
  • 12

1 Answers1

2

Remove the " before value field

Modified Code :

<input type="button" name="test" value="Edit" id="<%=x%>"/>
atish shimpi
  • 4,873
  • 2
  • 32
  • 50