script多个同名控件的遍历访问
<form id="Form1" method="post">
<input type="text" id="sname" name="sname" >
<input type="text" id="sname" name="sname" >
<input type=button onclick = "doit()" value = "do">
<script>
function doit(){
// alert(document.all("sname").length);
for(i =0;i<document.all("sname").length;i++)
{
alert(document.all("sname",i).value);
}
}
</script>
<input type="text" id="sname" name="sname" >
<input type="text" id="sname" name="sname" >
<input type=button onclick = "doit()" value = "do">
<script>
function doit(){
// alert(document.all("sname").length);
for(i =0;i<document.all("sname").length;i++)
{
alert(document.all("sname",i).value);
}
}
</script>