原文网址:http://lilywangcn.iteye.com/blog/973943
属性为readonly的input不允许用户输入内容,然而在ie或chrome中,属性为readonly的input 和一般input从界面上来看没有任何区别,会给用户输入带来稍许不便。可以通过为其设置css来加以区分。
在ie浏览器中:
- input{background-color:expression((this.readOnly && this.readOnly == true)? "#efefef":"");}
在chrome中
- input[readonly]{
- background-color: #efefef;
- }