
// 改成这样<input type="text" name="username" value='<%=UserLoginId %>' id="username" required="required" placeholder="用户名" onblur="var v=this.valuewhile(v.length<6){v='0'+v}this.value=v" />1)在input失去焦点的func里面操作,
2)检查文本的长度:
if 文本长度离目标长度相差n的话
then input的文本 = n*0 + 原文本
即可。