Java textarea在加载值为的文档时不起作用
下面的代码显示了我尝试过的代码Java textarea在加载值为的文档时不起作用,java,html,spring,spring-mvc,jsp,Java,Html,Spring,Spring Mvc,Jsp,下面的代码显示了我尝试过的代码 <textarea name="description" id="description" cols="30" rows="5" wrap="soft" value="${event.description}"></textarea> 如果我们尝试输入type=text,则会给出输出 <input id="description" type="text" class="datepicker" value="${ev
<textarea name="description" id="description" cols="30" rows="5" wrap="soft" value="${event.description}"></textarea>
如果我们尝试输入type=text,则会给出输出
<input id="description" type="text" class="datepicker" value="${event.description}">
请告诉任何人为什么会这样,以及如何解决 您可以尝试此操作,textarea的值必须包含在标记中:
<textarea name="description" id="description" cols="30" rows="5" wrap="soft">${event.description}</textarea>
${event.description}
没有值
属性。它有textContent
,因此您应该执行以下操作:
<textarea>${event.description}</textarea>
${event.description}
HTML
textarea
不会提供值属性
。相反,如果我们想访问HTML区域内的值,那么我们需要将值放在
开始和结束标记之间,即
<textarea name="description" id="description" cols="30" rows="5" wrap="soft">
${event.description}
</textarea>
${event.description}
非常感谢您的回复。行得通。我不知道那个问题。