<html> <head> <title>Online JavaScript Tester</title> <style type="text/css"> input{ background-color:expression(this.readOnly==true?"#EEEEEE":"#FFFFFF"); } input[readonly]{ background-color:#EEEEEE; } </style> <script> </script> </head> <body> <input type="text" readonly/> <input type="text"/> <input type="text" readonly="true"/> <input type="text" readonly="false"/> </body> </html>