js traverses page controls,
var inputArr = document.forms[0];
for( var i = 0; i < inputArr.length; i ) {
if( inputArr[i].type.toUpperCase() == "BUTTON" ) {
inputArr[i].disabled= "disabled";
}else if( inputArr[i].type.toUpperCase() == "FILE" ){
inputArr[i].readonly=true;
}
}
Another method:
var Elements = document.getElementsByTagName_r("*");
var msgs;
var i;
for ( i in Elements ) {
if ( Elements[i].type == "text" ) {
alert(Elements[i]. value);
}
}
JS traversal control value
"width: 100px">
: 100px">
🎜> table>