Nhập vào một ngày (max = '2015-12-31'):
Nhập vào một năm (max = 2015):
Code <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<form>
Nhập vào một ngày (max = '2015-12-31'): <input type="date" name="ngaytruoc" max="2015-12-31"><br>
Nhập vào một năm (max = 2015): <input type="number" name="nam" max="2015"><br>
<input type="submit" value="Gửi">
</form>
</body>
</html>