当前位置: 移动技术网 > IT编程>开发语言>JavaScript > javascript 表单的友好用户体现

javascript 表单的友好用户体现

2019年07月29日  | 移动技术网IT编程  | 我要评论
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>test</title>
<script language="javascript" type="text/javascript">
function validatelength(obj)
{
return obj.value.length < obj.getattribute("maxlength");
}
</script>
</head>
<body>
<label for="username">用户名:</label>
<input id="username" type="text" maxlength="10" onmouseover="this.focus();" onfocus="this.select();" /><br /><br />

<label for="password">密码 :</label>
<input id="password" type="password" onmouseover="this.focus();" onfocus="this.select();" /><br /><br />

<label for="remark">备注 :</label>
<textarea id="remark" onkeypress="return validatelength(this);" onmouseover="this.focus();" onfocus="this.select();" maxlength="50" cols="50" rows="5"></textarea>
</body>
</html>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网