Guarda questo
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form id="f1" action="post">
<input type="text" id="i1">
<input type="text" id="i2">
<input type="text" id="i3">
<input type="text" id="i4">
</form>
<script language="JavaScript" type="text/javascript">
<!--
a = document.getElementById('f1').children.length;
for (i=0;i<a;i++) {
curObj = document.getElementById('f1').children(i);
alert(curObj.id + ' ' + curObj.tagName + ' ' + curObj.type);
} // for (i=0;i<a;i++)
//-->
</script>
</body>
</html>