HTMLInputElement: readOnly property - Web APIs | MDN

Value

A boolean.

Examples

js

const inputElement = document.getElementById("total");
console.log(inputElement.readOnly);
inputElement.readOnly = true;

Specifications

Specification
HTML
# dom-input-readonly

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.