某些浏览器可能会为禁用的表单元素覆盖或提供默认样式。(将文本涂成灰色或浮雕)Internet Explorer 5.5对此特别讨厌。
禁用的表单元素不会获得焦点。
在选项卡导航中会跳过禁用的表单元素。
只读属性
Not all form elements have a readonly attribute. Most notable, the <SELECT> , <OPTION> , and <BUTTON> elements do not have readonly
attributes (although they both have disabled attributes)
Browsers provide no default overridden visual feedback that the form element is read only. (This can be a problem… see below.)
Form elements with the readonly attribute set will get passed to the form processor.
Read only form elements can receive the focus
Read only form elements are included in tabbed navigation.
一个
readonly
元素就是不可编辑,但是当根据被发送form
的提交。一个disabled
元素是不可编辑和提交不发送电子邮件。另一个区别是readonly
元素可以集中(而“通过表格制表”时要集中)而disabled
元素不能集中。在这篇很棒的文章或w3c的定义中阅读有关此内容的更多信息。引用重要的部分: