YouTip LogoYouTip

Prop Week Readonly

HTML DOM Input Week readOnly Property

HTML DOM Input Week readOnly Property

-- Learning is not just about technology, it's about dreams!

JavaScript Reference

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<input> - url

<keygen>

Input Week readOnly Property

Input Week Object Reference Input Week Object

Example

Set the week field to read-only:

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

Output:

Try it Yourself Β»


Definition and Usage

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the readOnly property.

Note: Internet Explorer or Firefox does not support the <input type="week"> element.


Syntax

Get the readOnly property:

weekObject.readOnly

Set the readOnly property:

weekObject.readOnly=true|false

Property Values

Value Description
true|false Specifies whether the week field is read-only

true - The week field is read-only
false - Default. The week field is not read-only

Technical Details

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

More Examples

Example

Check if the week field is read-only:

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

The value of x will be:

true

Try it Yourself Β»


Related Pages

HTML Reference: HTML <input> readonly Attribute


Input Week Object Reference Input Week Object

← Prop Week ReadonlyProp Week Name β†’