<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("pwd").type;
alert(x);
}
</script>
</head>
<body>
<form>
Password: <input type="password" id="pwd">
</form>
<button type="button" onclick="displayResult()">Display input type</button>
</body>
</html>