App下载
实例代码( Tip: 登录后体验更佳 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool(w3cschool.cn)</title>
<script>
function displayResult(){
var x=document.getElementById("pwd").maxLength;
alert(x);
}
</script>
</head>
<body>
<form>
: <input type="password" id="pwd" maxlength="8">
</form>
<button type="button" onclick="displayResult()"></button>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
运行结果