Easy Tutorial
❮ Jsref Switch Prop Audio Currenttime ❯

Input URL readOnly Attribute

Input URL Object

Example

Set the URL field to read-only:

Output result:


Definition and Usage

The readOnly attribute is used to set or return whether the URL field is read-only.

Read-only fields cannot be modified. However, their content can be copied.

This attribute reflects the HTML readonly attribute.

Tip: To ensure the accuracy of form data, you can use the disabled attribute instead.


Browser Support

All major browsers support the readOnly attribute.

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


Syntax

Return the readOnly attribute:

Set the readOnly attribute:

Attribute Values

Value Description
true false Describes whether the URL field is read-only. true - The URL field is read-only. false - Default. The URL field is not read-only.

Technical Details

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


More Examples

Example

Check if the URL field is read-only:


Related Pages

HTML Reference: HTML <input> readonly Attribute


❮ Jsref Switch Prop Audio Currenttime ❯