只读输入框
为输入框设置 readonly
属性可以禁止用户输入,并且输入框的样式也是禁用状态。
<input class="form-control" type="text" placeholder="Readonly input here…" readonly>
不可编辑输入框
在Bootstrap中,为input输入框设置 disabled
属性可以禁止其与用户有任何交互(焦点、输入等)。被禁用的输入框颜色更浅,并且还添加了 not-allowed 鼠标状态。
<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>