This is not supported in IE. More info: http://dev.jquery.com/ticket/120
The fix is to create a new input with type=password and copy any attributes from the old one. - Richard On Jan 29, 2008 12:02 PM, Jamal Arbib <[EMAIL PROTECTED]> wrote: > > Hi > > I want to change the input's type, from "text" to "password" using the > focus event. I use the following jquey code > > <script type="text/javascript" language="javascript"> > $(document).ready(function(){ > $("#passwd").focus( function() { > $(this).attr("value",""); > $(this).attr("type","password"); > } ); > }); > </script> > > Il woks nice in FireFox but not in IE ! I tried diffent a way like : > > $("[EMAIL PROTECTED]'password']").focus( function() { > $(this).attr("value",""); > $(this).attr("type","password"); > } ); > > > or : > > document.getElementsByTagName("password").setAttribute("type", > "password"); > > Here is my html code: > > > <form method="post" id="loginID"> > <input name="password" type="text" id="passwd" value="Your > password" /> > ...... > </form> > > thanks for your help. > > Djam > >