0

I'd like to find out how this is commonly implemented, mainly because I can't seem to find it in the source code - it's the "graying out" of text that happens whenever a menu-option/button is unable to be clicked. I'm trying to find it in firebug but this is what I find for the image:

<input
    type="submit"
    onclick="LoadingMsg();"
    class="btnclass"
    disabled="disabled"
    id="ctl00_ctl00_Content_ContentItems_btnUpdateQuotas1"
    value="Update Quotas"
    name="ctl00$ctl00$Content$ContentItems$btnUpdateQuotas1"
>

This is what it looks like:

enter image description here

4

1 回答 1

6

它是 HTML,但可以使用 JavaScript 来操作 HTML 输入/选择元素以具有该属性。

这是执行此操作的属性:disabled="disabled"

JavaScript 操作此属性的一个基本示例是:

document.getElementById('elementid').disabled = true;  // Disable element
document.getElementById('elementid').disabled = false; // Enableelement

资源:禁用属性

于 2012-07-20T14:16:49.540 回答