javascript 表单的友好用户体现

<input type=”text” onmouseover=”this.select()”
value=”this.select()”> <input type=”text”
onmouseover=”this.focus()” value=”this.focus()”>

<html xmlns=”” >
<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 />

[Ctrl+A 全体采摘 提醒:你可先更正部分代码,再按运转]

<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>

xmlns=”” head
titletest/title script language=”javascript” type=”text/javascript”
function validateLength(obj) { return obj.value.length
obj.getAttr…

发表评论

电子邮件地址不会被公开。 必填项已用*标注