Easy Tutorial
❮ Prop Style Justifycontent Prop Del Cite ❯

Input URL disabled Attribute

Input URL Object

Example

Disable the URL field:

document.getElementById("myURL").disabled = true;

Output result:


Definition and Usage

The disabled attribute is used to set or return whether the URL field is disabled.

Elements with the disabled attribute are unusable and unclickable. Disabled elements are typically displayed as grayed out in the browser.

This attribute reflects the HTML disabled attribute.


Browser Support

All major browsers support the disabled attribute.

Note: Internet Explorer or Safari browsers do not support the HTML <input> element with the type="url" attribute.


Syntax

Return the disabled attribute:

Set the disabled attribute:

Attribute Values

Value Description
true|false Describes whether the URL field is usable. true - URL field is unusable<br>false - Default. URL field is usable

Technical Details

| Return Value: | Boolean, returns true if the URL field is unusable, otherwise returns false | | --- | --- |


More Examples

Example

Check if the URL field is usable:

var x = document.getElementById("myURL").disabled;
true

Example

Disable or enable the URL field:

function disableBtn() {    document.getElementById("myURL").disabled = true;
}
function undisableBtn() {    document.getElementById("myURL").disabled = false;
}

Related Pages

HTML Reference: HTML <input> disabled Attribute


❮ Prop Style Justifycontent Prop Del Cite ❯