document.form.item 问题集合的(0)和[0]取法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<form method="post" action="" id="f1_id" name="f1">
<input id="ip1_id" name="ip1" type="text" name="" value="tom"/>
</form>
</body>
<script language="JavaScript" type="text/javascript">
<!--
(function(){
var formc;
if(document.all){
//IE
//formc=document.forms["f1"].item("ip1").value;
//formc=document.forms("f1").item("ip1").value;
//formc=document.f1_id.ip1_id.value;
formc=document.getElementsByName("ip1")(0).value;
//formc=document.forms["f1"].item("ip1").value;
//alert(document.forms["f1"]);
}else{
//IE FF[/color]
formc=[color=red]document.forms["f1"].elements["ip1"];
}
alert(formc);
})();
//-->
</script>
</html>