Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/02/2012, 21:57
furoya
(Desactivado)
 
Fecha de Ingreso: noviembre-2002
Ubicación: Ciudad Autónoma de Buenos Aires
Mensajes: 2.367
Antigüedad: 21 años, 6 meses
Puntos: 317
Respuesta: Mostrar "Constraseña" en textbox password

¿Sabes que ni hace falta JS?. El único que dicen que aún no lo reconoce es IE (al menos hasta la versión 9), así que con un conditional comment nos arreglaríamos para meterle la imagen.

Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<title></title>
<style type="text/css">
#pw {width: 180px; height: 27px; background-color: #ccccff; font-size: 22px; font-weight: bold;}
</style>
</head>
<body>

<!--[if IE]>
<style type="text/css">
#pw {background-image: url(http://static.forosdelweb.com/fdwtheme/2010/home.png); background-position:-140px 0;}
</style>
<![endif]-->

<input type=password placeholder="Foros del Web" id="pw">

</body>
</html> 
En IE6 el color de fondo no se ve porque la imagen es *.png con alpha channel, y por supuesto, no le interpreta la transparencia.

Como dato adicional: está previsto darle formato CSS al texto marcador. Por ahora lo soportan (mal) algunos navegadores.