VOOZH about

URL: https://www.geeksforgeeks.org/html/html-input-readonly-attribute/

⇱ HTML input readonly Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML input readonly Attribute

Last Updated : 25 May, 2026

The readonly attribute is used to make an input field non-editable while still allowing users to view and select its value. The field value is also submitted with the form.

  • Prevents users from modifying the input value.
  • The input field can still be focused and its value can be selected.
  • Unlike disabled fields, readonly inputs are included in form submission.

Syntax:

<input readonly>

Example: This example uses HTML <input> readonly Attribute. 

Comment
Article Tags: