<input type=text id="a1">
<input type=password id="a2"><script language="JavaScript">
<!--
alert("a1:" + document.all.a1.type);
alert("a2:" + document.all.a2.type);
//-->
</script>
<input type=password id="a2"><script language="JavaScript">
<!--
alert("a1:" + document.all.a1.type);
alert("a2:" + document.all.a2.type);
//-->
</script>
<input type="text" name="test1"><input type="button" onclick="alert(document.frm.test1.type);">
<input type="password" name="test2"><input type="button" onclick="alert(document.frm.test2.type);">
</form>