dlfdlfdlf

问题:html中如何限制输入框允许输入的字符长度

解决办法:给input标签添加属性值:maxlength="允许输入最长的字符长度"

复制代码
 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <meta charset="UTF-8" />
 5     <title>test</title>
 6 </head>
 7 <body>
 8     最大只能输入12个字符的输入框:<input type="text" maxlength="12">
 9 </body>
10 </html>
复制代码

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-05-25
  • 2021-11-24
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2022-01-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案