html - 为什么输入的默认最大长度为 524288?

标签 html w3c html-input

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/

相关文章:

html - 为什么将具有 `inline-block` 的 `overflow:hidden` 元素的基线设置为其底部边距?

html - 在文件类型输入中更改光标

javascript - 迭代 JavaScript URL 对象的属性

html - 元素导航上属性角色的错误值分页

memory-leaks - UIWebView 中类型范围泄漏的输入元素

html - 如何始终检测浏览器对 HTML5 搜索输入的支持?

html - css html 鼠标悬停

html - 负 z-index 有副作用吗

html - 所有 block 都应该水平放置

html - CSS Slider 不断崩溃