日期:2014-05-16  浏览次数:20304 次

求一脚本,谢谢大家啊,很急
想通过一table的id,将该table内的所有input元素改成可写的,之前默认是只读

------解决方案--------------------
var objs = document.getElementById( "table1 ").getElementsByTagName( "input ");
for(var i=0;i <objs.length;i++)
{
objs[i].removeAttribute( "disabled ");
objs[i].removeAttribute( "readonly ");
}
------解决方案--------------------
function mm(tableid)
{
var inputs = document.getElementById(tableid).getElementsByTagName( "INPUT ");
for(var i=0; i <inputs.length; i++)
{
if(inputs[i].type== "text " && inputs[i].readOnly)
inputs[i].readOnly = false;
}
}