SO fiddle

Test Fiddle mainly for SO Questions

by Nick Craver

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/overcast/jquery-ui.css">
<form class="form">
    <input type="password" name="myPassword" />
</form>
<button>Change to text</button>

JavaScript

$("button").click(function() {
    $('.form').find('input:password').each(function() {
       $("<input type='text' />").attr({ name: this.name, value: this.value }).insertBefore(this);
    }).remove();
});