<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> </head> <body> <script type="text/javascript"> <!-- function gettype(){ var ctrls=document.getElementsByTagName("input"); for(var i=0;i<ctrls.length;i++){ alert("type:"+ctrls.item(i).type+",id:"+ctrls.item(i).id +",name:"+ctrls.item(i).name); } } //--> </script> <input type="text" name="myname" id="myid"> <input type="button" name="myname" id="mybtn" value="my button" onclick="gettype()"> <input type="submit" name="myname" id="mysubmit"> <input type="text" name="myname" id="username"> </body> </html>