IE 、 firefox、 chrome 表单中文本框如果属性是只读,浏览器默认firefox有灰掉的效果,IE 、 chrome无效果IE下加如下代码可解决,
<style>
input {
background-color: expression(( this.readOnly && this.readOnly == true)
? "#cccccc" : "" )
}</style>chrome 有什么办法解决没? 不然用户体验很差,看上去都要输入的样子
<style>
input {
background-color: expression(( this.readOnly && this.readOnly == true)
? "#cccccc" : "" )
}</style>chrome 有什么办法解决没? 不然用户体验很差,看上去都要输入的样子
<script>
var obj = document.getElementsByTagName('input');
for(var i=0,len=obj.length; i<len; i++){
obj[i].style.backgroundColor = obj[i].readOnly ? '#ccc' : '';
}
</script>不建议使用 expression