Home > Article > Web Front-end > How to set the bootstrap input box to be read-only
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".
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:
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!