Home >Web Front-end >HTML Tutorial >How to make html input non-editable
html How to set the input to be non-editable: 1. Use the disabled attribute to specify that the input element is disabled; 2. Use the readonly attribute to specify that the input field is read-only and copyable; 3. Implement it through "readonly unselectable="on"" Not editable.
The operating environment of this article: Windows 7 system, HTML5 version, Dell G3 computer.
3 ways to make the input text box uneditable
Today I tried 3 ways to make the input text box uneditable. Now I’ll summarize:
The disabled attribute stipulates that the input element should be disabled. A disabled input element cannot be edited, copied, selected, cannot receive focus, and the background will not receive passed values. After setting, the color of the text will turn gray. The disabled attribute cannot be used with .
Example:
The above is the detailed content of How to make html input non-editable. For more information, please follow other related articles on the PHP Chinese website!