Question: I have a registration form, and i want to use a password field. The problem is, i want it to have a placeholder saying "Password" at the begining so i'm using a text field instead. I need to turn the characters into asterisks or black circles like a password field when the user starts typing.  

I've tried changing the "type" attribute to "password" through javascript, so i'm stuck.  

Is there a simple way to resolve this with css? or does anyone know of a good javascript(preferably jquery) to hack this?  

Thanks

Answer: 
You could use the HTML5 [`placeholder` attribute](http://www.w3schools.com/html5/att_input_placeholder.asp) However, that will not work in all browsers (especially older ones).

```
<input type="password" name="pwd" placeholder="Enter Password" />

```
Generally, browsers frown at changing the `type` attribute of `input` elements via JavaScript. Most workarounds involve cloning the `input` with the new `type`, and removing the original.

You could absolutely position the label over the input form, and remove it on focus.

You should consider the implications of not using `type="password"` - it is the semantically correct option.

### Update

Upon reading [David Dorward's answer](https://stackoverflow.com/questions/4777230/html-text-field-to-behave-like-a-password-field/4777247#4777247), you should strongly consider his very valid points.