function func3(a){
var b=a.parentElement;
alert(b.id)
alert(b.childNodes.length)
alert(b.childNodes[1].name)
b.childNodes[1].disabled=false;
var c=document.getElementsByTagName("input");
for(var i=0;i<c.length;i++){
if(c[i].type=="checkbox"){ if(c[i].name != a.name){ c[i].disabled=true;
}
}
}
}
<table>
<tr>
<td id="aa"><input type="checkbox" name="id1" onclick="func3(this)"><input type="button" value="修改" name="editbutton1" disabled>
</td>
</tr> <tr>
<td id="bb"><input type="checkbox" name="id2" onclick="func3(this)"><input type="button" value="修改" name="editbutton2"
disabled>
</td>
</tr>
</table>
var b=a.parentElement;
alert(b.id)
alert(b.childNodes.length)
alert(b.childNodes[1].name)
b.childNodes[1].disabled=false;
var c=document.getElementsByTagName("input");
for(var i=0;i<c.length;i++){
if(c[i].type=="checkbox"){ if(c[i].name != a.name){ c[i].disabled=true;
}
}
}
}
<table>
<tr>
<td id="aa"><input type="checkbox" name="id1" onclick="func3(this)"><input type="button" value="修改" name="editbutton1" disabled>
</td>
</tr> <tr>
<td id="bb"><input type="checkbox" name="id2" onclick="func3(this)"><input type="button" value="修改" name="editbutton2"
disabled>
</td>
</tr>
</table>
disabled>
这是个button呀,不是checkbox了,