水荷 2012-06-14
functionRemoveControl(elements)
{
vararrObj=newArray();
varcount=elements.length;
for(vari=0;i<count;i++)
{
if(elements[i]==undefined)
continue;
varobj=document.createElement('label');
switch(elements[i].type)
{
case"text":
obj.style.width=elements[i].style.width;
obj.classname="word_warpbreak";
obj.setAttribute("innerHTML",elements[i].value);
break;
case"textarea":
obj.style.width=elements[i].style.width;
obj.classname="word_warpbreak";
obj.setAttribute("innerHTML",elements[i].innerHTML);
elements[i].innerHTML='';
break;
case"select-one":
for(varj=0;j<elements[i].length;j++)
{
if(elements[i][j].selected)
{
obj.style.width=elements[i].style.width;
obj.classname="word_warpbreak";
obj.setAttribute("innerHTML",elements[i][j].text);
break;
}
}
elements[i].options.length=0;
break;
}
elements[i].parentNode.insertBefore(obj,elements[i]);
arrObj[arrObj.length]=elements[i];
}
现在用top.innerHTML="..........";的方法就可以向这个id的位置写入HTML代码了。例如top.innerHTML="<input type="button" name=&qu
JavaScript代码innerHTML='<option>1</option>'的时候测试出来的结果却是"1</option>",ie6 7 8 都存在这个问题。经过测试,发现 在用innerHT