<input type= "text " name= "text1 " />
<input type= "text " name= "text2 "/>
<input type= "text " name= "text3 "/>
...
...
...
<input type= "text " name= "alltext "/>
<input type= "buttom " onclick= "PassList(); "/>
请问按钮的PassList怎么写才能把text1 text2 text3...的值 赋给 alltext
------解决方案--------------------------------------------------------
才刚看错了 你可以这样取
==========================
function PassList()
{
var arrObj = document.all;
for(var i = 0; i < arrObj.length;i++)
{
if(typeof arrObj[i].type != "undefined " && arrObj[i].type== 'text ')
{
arrObj[i].value //循环取得所有text的值
}
}
}
------解决方案--------------------------------------------------------
function PassList()
{
var v = " ";
var elems = document.form[0].elements;
for(var i=0;i <elems.length;i++)
{
var e = elems[i];
if(e.type== "text " && e.name!= "alltext "){
v += e.value;
}
}
document.all[ "alltext "].value = v;
}