html checked属性值,HTML复选框的checked属性的值是多少?
8種機械鍵盤軸體對比
本人程序員,要買一個寫代碼的鍵盤,請問紅軸和茶軸怎么選?
我們都知道如何在HTML中構成復選框輸入:
我不知道 - 選中復選框的技術上正確的值是多少?我已經看到了這些工作:
答案是無關緊要的?我沒有看到答案標記為正確的證據[這里< /
a>來自規范本身:Checkboxes (and radio buttons) are on/off switches that may be toggled by
the user. A switch is “on” when the control element’s checked attribute is
set. When a form is submitted, only “on” checkbox controls can become
successful. Several checkboxes in a form may share the same control name.
Thus, for example, checkboxes allow users to select several values for the
same property. The INPUT element is used to create a checkbox control.
規格作家會說什么是正確的答案?請提供以證據為基礎的答案。
嚴格地說,你應該把一些有意義的東西 -
根據規范這里,最正確的版本是:
對于HTML,您也可以使用[空屬性語法
但實際上,大多數瀏覽器只支持引號之間的任何值。所有以下內容將被檢查:
只有以下內容才會被取消選中:
HTML5規范 :The disabled content attribute is a boolean attribute.The presence of a boolean attribute on an element represents the true value,
and the absence of the attribute represents the false value.
>If the attribute is present, its value must either be the empty string or a
value that is an ASCII case-insensitive match for the attribute’s canonical
name, with no leading or trailing whitespace.
結論:
以下是 有效的,等同的和真實的 :
以下是 無效 :
缺少該屬性是 false 的唯一有效語法:
建議
由于&lt; input checked&gt;是無效的XHTML(但是有效的HTML)和其他的選擇是如果你關心寫有效的XHTML,使用checked =“checked”可讀性較差。否則,只需使用&lt;輸入檢查&gt; `,因為它更短。
未經作者同意,本文嚴禁轉載,違者必究!
總結
以上是生活随笔為你收集整理的html checked属性值,HTML复选框的checked属性的值是多少?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: httpsurlconnection 写
- 下一篇: 2017年html5行业报告,云适配发布