I'm trying to change an input type onevent, but not having any luck. Is it possible?

Is can get the type by using
Code:
<p>
<input id="password" name="Password" type="text" value="Password" onclick="alert(this.type)"></input>
</p>
but I can't seem to change the type from here.
As an alternative I was thinking of using
Code:
<p>
<input id="password" name="Password" type="text" value="Password" onclick="this.parentElement.innerHTML='<input type=password value=password></input>'"></input>
</p>
Any suggestions? It's only so I can have "password" written in the input, which changes to &bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;
when clicked.