Home  >  Article  >  Web Front-end  >  How to set the bootstrap input box to be read-only

How to set the bootstrap input box to be read-only

藏色散人
藏色散人Original
2020-12-07 09:31:453188browse

How to set read-only for the bootstrap input box: first open the corresponding code file; then set the readonly attribute for the input box, with statements such as "placeholder="Readonly input here..." readonly".

How to set the bootstrap input box to be read-only

The operating environment of this tutorial: windows7 system, bootsrap3.3.7 version, Dell G3 computer

Recommended: "bootstrap video tutorial》《css video tutorial

Read-only input box

Set the readonly attribute for the input box to prohibit user input, and the input box The style is also disabled.

<input class="form-control" type="text" placeholder="Readonly input here…" readonly>

Rendering:

How to set the bootstrap input box to be read-only

readonly attribute

readonly attribute is a Boolean attribute.

The readonly attribute specifies that the input field is read-only.

Read-only fields cannot be modified. However, users can still tab to the field and select or copy its text.

The readonly attribute prevents users from modifying the value until certain conditions are met (such as a checkbox being selected). Then, you need to use JavaScript to eliminate the readonly value and switch the input field to an editable state.

The above is the detailed content of How to set the bootstrap input box to be read-only. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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