Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <input> readonly Attribute

The readonly attribute on an <input> tag specifies that the input element is read-only, which means the field is non-editable.

Values from read-only input elements are included during form submission.

Example

#

A readonly attribute on an <input> element.
The text field is not editable, but its value is included during form submission.




<form action="/tutorial/action.html">
  <label for="title">Title</label><br />
  <input type="text" id="title" name="title"
         value="Gone with the Wind" readonly><br /><br />

  <input type="submit">
</form>

Using readonly

The readonly attribute specifies that an input element is read-only.

An input control with readonly enabled cannot be modified, but it will send its data when submitted.


Syntax

<input readonly>

Browser support

Here is when readonly support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <input>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides