HTML 输入的默认最大长度 ( <input type="text">
) 是 524288
人物。这似乎是一个非常奇怪的数字,为什么选择它?
最佳答案
根据w3c最大值无限制:
maxlength = number [CN]
When the type attribute has the value "text" or "password", this attribute specifies the maximum number of characters the user may enter. This number may exceed the specified size, in which case the user agent should offer a scrolling mechanism. The default value for this attribute is an unlimited number.
尽管如此,我注意到在 Chrome 中确实将 maxlength
默认为 524288,这对我来说似乎是一个“错误”,或者至少是故意选择将输入限制为 512KB(感谢Benjamin Udink ten Cate 指出这一点)。
关于html - 为什么输入的默认最大长度为 524288?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26469152/