如何添加HTML元素中允许的最大字符数?
使用maxlength属性在HTML中添加最大值。您可以尝试运行以下代码以实现maxlength属性-
示例
<!DOCTYPE html><html>
<body>
<form action = "">
Rank:
<input type = "number" name = "rank" min = "1" max = "10"><br>
Cricketer:
<input type = "text" name = "cricketer" maxlength = "20"><br>
<input type = "submit" value = ”Submit”>
</form>
</body>
</html>
以上是 如何添加HTML元素中允许的最大字符数? 的全部内容, 来源链接: utcz.com/z/335141.html