Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/03/2005, 15:39
thunder.scripts
 
Fecha de Ingreso: febrero-2005
Mensajes: 670
Antigüedad: 20 años, 1 mes
Puntos: 0
Ya sé que ya lo solucionaste, pero le puede servir a alguien. También lo podés hacer con css:
Código HTML:
<style type="text/css">
input[type=text]:focus {
   background-color: #FFFFFF;
} 

input[type=text] {
   background-color: #FFFF99;
} 
</style> 
Lo bueno es que funciona aunque deshabiliten javascript, y te lo aplica directamente a todos los input del documento. Si querés restringirlo a alguno en especial, podés ponerle el atributo class al input y listo, ej:
Código HTML:
...
<style type="text/css">
.inputtext input[type=text]:focus {
   background-color: #FFFFFF;
} 

.inputtext input[type=text] {
   background-color: #FFFF99;
} 
</style>
</head>
<body>
<input type="text" class="inputtext">
...
__________________
Federico H. García
Desarrollo Web
www.federicog.com.ar