html checked属性值,HTML复选框的checked属性的值是多少?
8種機械鍵盤軸體對比
本人程序員,要買一個寫代碼的鍵盤,請問紅軸和茶軸怎么選?
我們都知道如何在HTML中構(gòu)成復(fù)選框輸入:
我不知道 - 選中復(fù)選框的技術(shù)上正確的值是多少?我已經(jīng)看到了這些工作:
答案是無關(guān)緊要的?我沒有看到答案標(biāo)記為正確的證據(jù)[這里< /
a>來自規(guī)范本身: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.
規(guī)格作家會說什么是正確的答案?請?zhí)峁┮宰C據(jù)為基礎(chǔ)的答案。
嚴格地說,你應(yīng)該把一些有意義的東西 -
根據(jù)規(guī)范這里,最正確的版本是:
對于HTML,您也可以使用[空屬性語法
但實際上,大多數(shù)瀏覽器只支持引號之間的任何值。所有以下內(nèi)容將被檢查:
只有以下內(nèi)容才會被取消選中:
HTML5規(guī)范 :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.
結(jié)論:
以下是 有效的,等同的和真實的 :
以下是 無效 :
缺少該屬性是 false 的唯一有效語法:
建議
由于&lt; input checked&gt;是無效的XHTML(但是有效的HTML)和其他的選擇是如果你關(guān)心寫有效的XHTML,使用checked =“checked”可讀性較差。否則,只需使用&lt;輸入檢查&gt; `,因為它更短。
未經(jīng)作者同意,本文嚴禁轉(zhuǎn)載,違者必究!
總結(jié)
以上是生活随笔為你收集整理的html checked属性值,HTML复选框的checked属性的值是多少?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: httpsurlconnection 写
- 下一篇: java 工具类sort_Java 通用