I have a website that uses a typical form for user creation. This form puts the name of the field inside the text box and uses a really simple script to clear the field name when the the field gets focus.
When getting the user's password, I'm currently clearing the field name ("Password" in this case), and then swapping the field type from text to password. This has worked fine in IE6, IE7, Firefox, and Safari, but seems to have broken in IE8.
I'm using the line ...
theBox.getAttribute('type')=='text'
... to check type and then ...
theBox.setAttribute('type','password')
... to change the type.
The script now breaks in IE8 on this line. I'm thinking I need to go with div swapping, but I was wondering if anyone else has run into this and might have a fix.