日期:2014-05-17 浏览次数:20962 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> new document </title>
  <meta name="generator" content="editplus" />
  <meta name="author" content="" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <style type="text/css">
.myDisabled
{
    background-color: #808080;
    border: 1px solid red;
    color: white;
}
  </style>
 </head>
 <body>
    <input type="text" value="文本1 disabled=true" disabled="true" />
    <br />
    <input type="text" value="文本2 readonly=true" readonly="true" />
    <br />
    <input type="text" value="文本3 class=myDisabled" readonly="true" class="myDisabled" />
 </body>
</html>
------解决方案--------------------
readonly可以取到值,disabled取不到值.
<html>
<head>
<style type="text/css">
.read { color:gray; }
</style>
</head>
<body>
<input type="text" value="test" readOnly class="read" />
</body>
</html>