<script language=javascript>
function check(){
alert(document.form1.name1.type);
document.all.div1.innerHTML = "<input name='name1' type='password' />";
}
</script><form method="post" action="" name="form1">
<div id="div1"><input name="name1" type="text" /></div>
<input type="button" value="确定" onClick="javascript:check()" />
function check(){
alert(document.form1.name1.type);
document.all.div1.innerHTML = "<input name='name1' type='password' />";
}
</script><form method="post" action="" name="form1">
<div id="div1"><input name="name1" type="text" /></div>
<input type="button" value="确定" onClick="javascript:check()" />
function check(){
alert(document.form1.name1.type);
var password = document.form1.name1.value;
document.all.div1.innerHTML = "<input name='name1' type='password'/>";
document.form1.name1.value = password
}
</script>