var inputs = document.getElementsByTagName("INPUT");
var count = 0;
for( var i = 0; i < inputs.length; i++ )
{
if( inputs[i].type = "file" )
{
count++;
}
}alert(count);
var count = 0;
for( var i = 0; i < inputs.length; i++ )
{
if( inputs[i].type = "file" )
{
count++;
}
}alert(count);
document.getElementsByName("file1").length
<input type="file" name="file1">
document.getElementsByName("file1").length
或者
<input type="file" name="file1">
<input type="file" name="file1">
document.all.file1.length效果一样!
<input type="file" name="file1">
document.getElementsByName("file1").length