Prop Url Readonly
# Input URL readOnly Property
[ Input URL Object](#)
## Example
Set the URL field to read-only:
document.getElementById("myURL").readOnly = true;
Output:
[Try it Β»](#)
* * *
## Definition and Usage
The readOnly property sets or returns whether a URL field is read-only.
Read-only fields cannot be modified. However, the user can copy the content of the field.
This property reflects the HTML readonly attribute.
**Tip:** To ensure the accuracy of form data, use the (#) property instead.
* * *
## Browser Support

The readOnly property is supported by all major browsers.
**Note:** Internet Explorer or Safari do not support the HTML element with the type="url" attribute.
* * *
## Syntax
Return the readOnly property:
_urlObject_.readOnly
Set the readOnly property:
_urlObject_.readOnly=true|false
## Property Values
| Value | Description |
| --- | --- |
| true|false | Specifies 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: | A Boolean. Returns true if the URL field is read-only, otherwise it returns false. |
| --- |
* * *
## More Examples
## Example
Check if the URL field is read-only:
var x = document.getElementById("myURL").readOnly;
The value of _x_ will be:
true
[Try it Β»](#)
* * *
## Related Pages
HTML Reference: (#)
* * Input URL Object](#)
YouTip