Prop Search Readonly
# Input Search readOnly Property
[ Input Search Object](#)
## Example
Set the search field to read-only:
```javascript
document.getElementById("mySearch").readOnly = true;
Output:
[Try it Β»](#)
* * *
## Definition and Usage
The readOnly property is used to set or return whether a search field is read-only.
A read-only field cannot be modified. However, the content of the field can be copied.
This property reflects the HTML readonly attribute.
**Tip:** To ensure the accuracy of form data, you can use the (#) property instead.
* * *
## Browser Support

The readOnly property is supported by all major browsers.
* * *
## Syntax
Return the readOnly property:
_searchObject_.readOnly
Set the readOnly property:
_searchObject_.readOnly=true|false
## Property Values
| Value | Description |
| --- | --- |
| true|false | Specifies whether the search field is read-only * true - The search field is read-only * false - Default. The search field is not read-only |
## Technical Details
| Return Value: | A Boolean value. Returns true if the search field is read-only, otherwise returns false. |
| --- |
* * *
## More Examples
## Example
Check if the search field is read-only:
```javascript
var x = document.getElementById("mySearch").readOnly;
The output of _x_ will be:
true
[Try it Β»](#)
* * *
## Related Pages
HTML Reference: (#)
* * Input Search Object](#)
YouTip