readonly =“true”与“true”之间的区别是什么? &安培;只读= QUOT;只读" ;? [英] What is the difference between readonly="true" & readonly="readonly"?
问题描述
有什么区别:
< input name =TextBox1type =textid =TextBox1 readonly =true/>
和:
< input name =TextBox1type =textid =TextBox1readonly =readonly/>
当我将 readonly
设置为 true
它与 readonly ='readonly'
有些不同。 W3C标准规定 readonly
应该是'readonly'
&不是'true'
。为什么大多数浏览器允许 readonly ='true'
,这与 readonly ='readonly'
?
赋予元素属性 readonly
将为该元素指定只读状态。无论你在后面放置什么值或者如果你在后面放置任何值都没有关系,它仍然会将其视为只读。放置 readonly =false
将无法正常工作。 建议使用W3C标准。
What is the difference between:
<input name="TextBox1" type="text" id="TextBox1" readonly="true" />
and:
<input name="TextBox1" type="text" id="TextBox1" readonly="readonly" />
When i set readonly
to true
it works somewhat different from readonly='readonly'
. W3C standard says readonly
should be 'readonly'
& not 'true'
. Why most of the browsers allow readonly='true'
which has somewhat different functionality than readonly='readonly'
?
Giving an element the attribute readonly
will give that element the readonly status. It doesn't matter what value you put after it or if you put any value after it, it will still see it as readonly. Putting readonly="false"
won't work.
Suggested is to use the W3C standard.
这篇关于readonly =“true”与“true”之间的区别是什么? &安培;只读= QUOT;只读" ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!