什么';使用html禁用按钮的正确方法是什么?

什么';使用html禁用按钮的正确方法是什么?,html,Html,可能重复: 我有以下资料: <button id="refreshLink" class="blue" type="button" title="Refresh Topic Grid" data-entity="Topic" data-href="/Admin/Contents/Reference"> <span class="center-icon sprite-arrow-circle"></span&

可能重复:

我有以下资料:

    <button id="refreshLink" class="blue" type="button" title="Refresh Topic Grid"
        data-entity="Topic"
        data-href="/Admin/Contents/Reference">
        <span class="center-icon sprite-arrow-circle"></span></button>
哪种方法是正确的?我感到困惑。

disabled=“disabled”和
disabled
是一回事

浏览器很好地理解这两者

<>我从未见过<代码>禁用= true< /Cord>,所以请考虑它可能不是一个好的实践。

编辑

有关信息,W3C建议如下:

<button disabled>

资料来源:

(保留历史记录的链接不正确:)

根据我的理解,功能是否正确


如果您给出disabled=xxx(即),它也可以工作,但是
disabled=disabled
是正确的一个第二个(
disabled=disabled
disabled
)都是正确的。您可以根据个人喜好选择使用哪一种。
disabled
属性是一个布尔属性,它是哪个版本的Html?我认为html5可以有不同的语法。您喜欢的web编辑器不建议您使用正确的语法吗(我使用Visual studio,这是它的一个功能)。另外
disabled=true
是无效的语法-请检查验证程序。对不起。我在和之间犯了一个错误。不是W3C,通常是充满了@Inkbug你(再次)说得对。同一评论有两处错误我用w3c链接替换了W3Cools链接。这样更好。删除了我的否决票。
<button disabled>
disabled=disabled