window.onload= function(){
var WrapDiv = document.getElentById('bg-main');
var theLabel = document.getElementsByTagName('label');
var theInput = document.getElementsByTagName('input');
for(i = 0; i<theInput.length; i++){
theInput[i].id = 'c' + i;
}
for(j = 0; j<theLabel.length; j++){
theLabel[j].setAttribute('for','c'+j);
}
}
网友评论