表单中的常见输入属性(2)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>常见表单输入属性(2)</title>
</head>
<body>
<form action="" method="get">
<!-- maxlength 属性规定输入字段允许的最大长度 -->
<input type="text" name="" placeholder="允许输入的最大长度" maxlength="3">
<!-- min 和 max 属性规定 <input> 元素的最小值和最大值 -->
<input type="number" name="" placeholder="允许输入的最大值" max="6">
<input type="number" name="" placeholder="允许输入的最小值" min="6">
<br>
<!-- required规定在提交表单之前必须填写输入字段 -->
<input type="text" name="" required placeholder="请输入用户名"><input type="submit" name="">
</form>
</body>
</html>