Change type="Text" to type="Password"
<html>
<head>
<script language="javascript" type="text/javascript">
function passit(obj, oType){
var newO=document.createElement('input');
newO.setAttribute('type', oType);
newO.setAttribute('name',obj.getAttribute('name'));
newO.setAttribute('id',obj.getAttribute('id'));
newO.size = obj.size;
newO.className = obj.className;
newO.onFocus = obj.onFocus;
newO.value = obj.value;
obj.parentNode.replaceChild(newO,obj);
newO.focus();
}
</script>
</head>
<body>
<input id="test" type="text">
<a href="javascript:passit(document.getElementById('test'),'password');">
Pword It
</a>
<a href="javascript:passit(document.getElementById('test'),'text');">Text</a>
</body>
</html>