<!DOCTYPE html>
<html>
<head>
<script>
function getElements()
··{
··var x=document.getElementsByTagName("input");
··alert(x.length);
··}
</script>
</head>
<body>
<input type="text" size="20"><br>
<input type="text" size="20"><br>
<input type="text" size="20"><br><br>
<input type="button" onclick="getElements()" value="How many input elements?">
</body>
</html>