function test() {
var txts = document.getElementsByName("txt");
for(i = 0; i < txts.length; i++) {
if(txts[i].value != '0') {
alert(txts[i].value);
}
}
}
页面中控件:
遍历该数组,得到不等于0的值,处理它
for(p in array)
{
if(p!=0)
{
//处理非零值
}
}