YouTip LogoYouTip

Prop Input Time Readonly

HTML DOM Input Time readOnly Property

HTML DOM Input Time readOnly Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

HTML DOM Input Text Object

<input> - url

Input Time readOnly Property

Input Time Object Reference Input Time Object

Example

Set the time field to read-only:

document.getElementById("myTime").readOnly = true;

Output:

Try it Β»


Definition and Usage

The readOnly property is used to set or return whether the time 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 disabled property instead.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The readOnly property is supported in all major browsers.

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


Syntax

Return the readOnly property:

timeObject.readOnly

Set the readOnly property:

timeObject.readOnly=true|false

Property Values

Value Description
true|false Specifies whether the time field is read-only
* true - The time field is read-only
* false - Default. The time field is not read-only

Technical Details

Return Value: A Boolean value. Returns true if the time field is read-only, otherwise returns false.

More Examples

Example

Check if the time field is read-only:

var x = document.getElementById("myTime").readOnly;

The x output will be:

true

Try it Β»


Related Pages

HTML Reference: HTML <input> readonly Attribute


Input Time Object Reference Input Time Object

← Prop Input Time NameProp Input Time Form β†’