Home > Web Front-end > JS Tutorial > Summary of several methods for setting text input boxes in form elements to be non-editable_javascript skills

Summary of several methods for setting text input boxes in form elements to be non-editable_javascript skills

WBOY
Release: 2016-05-16 17:12:34
Original
1174 people have browsed it

Code:

Copy code The code is as follows:


The input box cannot get focus and cannot be edited
The form can get the value.
Can be copied.
It’s quite strange, you’ve selected it, but you haven’t gained focus yet?

2,readonly

Code:

The input box is read-only. Cannot be edited
The same form can get the value.
Can also be copied.

3,disabled

Code:

Copy code The code is as follows:



The input box is gray and cannot be edited
You can use JS to change or get its value, but submit This value is not submitted when
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template