HTML只读文本字段值不可见

时间:2017-03-15 13:56:37

标签: html5

<div class="col-sm-5">
    <div class="form-group">
        <label>Item Number</label>
        <input type="text" ng-model="choice.number" value="123456" class="form-control" readonly>
    </div>
</div>

为什么&#34; readonly&#34;输入字段值不可见?

1 个答案:

答案 0 :(得分:2)

应该可见(Bootstrap docs)。样式表中还有其他内容。

在浏览器中打开developer tools并检查元素(及其父级&#39;)样式声明。也许有像

这样的东西
[readonly] {
  color: white;
}

不知不觉地应用。或者Angular控制器删除该值。您可以在页面加载后的某个时间使用console.log(input.value)来检查。