如果字段DisplayName UserName为空
,如何设置输入字段默认值<td><form:input type="text" path="fieldDisplayName_UserName" id="fieldDisplayName_UserName" onblur="if (this.value == '')
{this.value = 'User Name';}"
onfocus="if (this.value == 'User Name') {this.value = '';}" /></td>
我正在尝试
<td><form:input type="text" path="fieldDisplayName_UserName"
id="fieldDisplayName_UserName" onblur="if (this.value == '')
{this.value = 'User Name';}" onfocus="if (this.value == 'User Name') {this.value = '';}" value="User Name"/></td>
但此值始终显示