只讀輸入框
爲輸入框設置 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>