diff options
Diffstat (limited to 'files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html')
| -rw-r--r-- | files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html b/files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html new file mode 100644 index 0000000000..057bca261d --- /dev/null +++ b/files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html @@ -0,0 +1,38 @@ +--- +title: disabled +slug: Mozilla/Tech/XUL/Attribute/disabled +tags: + - XUL Attributes +translation_of: Archive/Mozilla/XUL/Attribute/disabled +--- +<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div> + +<dl> + <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt> + <dd> </dd> + <dd> + <h5 id="类型boolean">类型:<em>boolean</em></h5> + </dd> + <dd> + <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5> + + <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p> + + <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p> + </dd> +</dl> + +<h4 id="示例:">示例:</h4> + +<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div> + +<pre><code>// Disabling an element +document.getElementById('buttonRemove').setAttribute("disabled", "true"); + +// Enabling back an element by removing the "disabled" attribute +document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre> + +<p></p><div class="blockIndicator standardNote"> + <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p> + <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p> +</div><p></p> |
