什么是禁用属性的正确值? [英] What is the correct value for the disabled attribute?

查看:93
本文介绍了什么是禁用属性的正确值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文本框或textarea的禁用属性的正确值是什么?

What is the correct value for the disabled attribute for a textbox or textarea?

我见过以前用过:

I've seen the following used before:

<input type="text" disabled />
<input type="text" disabled="disabled" />
<input type="text" disabled="true" />


推荐答案


  • 对于XHTML, code>< input type =textdisabled =disabled/> 是有效的标记

  • 对于HTML5,< input type =textdisabled /> 是有效的,并由W3C在其样本上使用。 所有主流浏览器。

    • For XHTML, <input type="text" disabled="disabled" /> is the valid markup.
    • For HTML5, <input type="text" disabled /> is valid and used by W3C on their samples.
    • In fact, both ways works on all major browsers.
    • 这篇关于什么是禁用属性的正确值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆