<tagname disabled="disabled">Values #ValueDescription disabled Use value 'disabled' or no value at all. Both are valid. Elements that accept disabledThe following elements accept the disabled attribute.ElementsDescription <input> Specifies an input field -- see example above <select> Specifies a ...
log( inputElement.disabled ); // *Still* prints "true" (这是因为 JavaScript 字符串 'false' 没有类型强制 转换为 JavaScript 布尔值 false)。 Also, some HTML attributes do have true and false as possible values, such as contentEditable (which also has inherit as a third option ), 还要考虑...
Attribute values of type ID and NAME must begin with a letter in the range A-Z or a-z and may be followed by letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). These values are case-sensitive....
<form action="/tutorial/action.html"> First name <input type="text" name="firstname" value="Sonia" disabled> <br /><br /> <input type="submit"> </form>Try it live The autofocus AttributeThe autofocus attribute specifies that the input field should receive focus when the page ...
Gets the value of the named attribute on the HtmlControl control. (Inherited from HtmlControl) GetData() Gets an IEnumerable object that represents the data source that is bound to the HtmlSelect control. GetDesignModeState() Gets design-time data for a control. (Inherited from Control) ...
Disabled Gets or sets a value indicating whether the HTML server control is disabled. (Inherited from HtmlControl) EnableTheming Gets or sets a value indicating whether themes apply to this control. (Inherited from Control) EnableViewState Gets or sets a value indicating whether the server ...
The Value property is equivalent to the value attribute of HTML elements. Applies to 產品版本 .NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 在GitHub 上與我們共同作業 您可以在 GitHub 上找到此內容的來源,在其中...
这些属性被称为布尔属性。布尔属性只能有一个值,这个值一般与属性名称相同。例如,考虑 disabled 属性,你可以将其分配给表单输入元素。用它来禁用表单输入元素,这样用户就不能输入了。被禁用的元素通常有一个灰色的外观。示例如下: <input type="text" disabled="disabled" /> <input type="text" disabled />...
Set the disabled property:optionObject.disabled = true|false Property ValuesValueDescription true|false Specifies whether an option in a drop-down list should be disabled or not. true - The option is disabled false - Default. The option is not disabled...
document.getElementById("myText").disabled=true; } functionundisableTxt() { document.getElementById("myText").disabled=false; } Try it Yourself » Related Pages HTML reference:HTML <input> disabled attribute ❮ Input Text Object Track your progress - it's free!