忽略一切花里胡哨,直接上代码;
<input class="form-control" autocomplete="off" readonly οnfοcus="this.removeAttribute('readonly');" id="dlmm" name="dlmm" type="password" placeholder="8位以上包含大小写字母和数字" maxlength="25" value="${user.dlmm}"/>
核心代码:
autocomplete="off" readonly οnfοcus="this.removeAttribute('readonly');"
最后还是说明下,浏览器会自动识别type="password" 填充历史的密码以及名称(前一个input)
但是有时候项目中不需要回填