Login textfield and password fields remove text on focus

inezkarachi

New Member
I'm developing the login section on my website and want it to use the same effect such as twitter has with the removal of the Username and Password values when the Textfield and Password field is on focus. I've tried using plain javascript for this with something of the following lines...\[code\]function PasswordClick(evt) { if ("Password" === this.value) this.valuehttp://stackoverflow.com/questions/6484770/= "";if(this.getAttribute('type')=='text') { this.setAttribute('type','password'); } this.focus();}\[/code\]It seems to cause problems using Chrome 12.0.742.100 on Windows and prob other web-kit browsers but works fine on Firefox.Has anyone got a better way of doing this?Thanks in advance.
 
Top