怎样才能将a框架选中的表格行复制到b框架的表格下去
主框架页面<body>
<iframe name="a" src="3.htm" width="590" height="240"></iframe>
<iframe name="b" src="2.htm" width="590" height="240"></iframe>
</body>
A框架所在页面<table width="500" border="1" id="demo">
<thead>
<tr>
<th> </th>
<th>字段1</th>
<th>字段2</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type=checkbox></td>
<td>R1C1</td>
<td>R1C2</td>
</tr>
<tr>
<td><input type=checkbox></td>
<td>R2C1</td>
<td>R2C2</td>
</tr>
<tr>
<td><input type=checkbox></td>
<td>222</td>
<td>234</td>
</tr>
</tbody>
</table>
<input type="button" id="btnCloneRow" value="复制表格行" />
<script type="text/javascript">
document.getElementById('btnCloneRow').onclick = function() {
var objTable=document.getElementById('demo')
var arrInputs=objTable.getElementsByTagName("input");
for(var i=0;i<arrInputs.length;i++) {
var objInput=arrInputs[i];
if(objInput.type=="checkbox"&&objInput.checked){
var oTbody = parent.frames['a'].document.getElementById('demo').getElementsByTagName('tbody')[0];
var oRow2 = oTbody.getElementsByTagName('tr')[i].cloneNode(true);
var kkk = parent.frames['b'].document.getElementById('kk').getElementsByTagName('tbody')[0];
kkk.appendChild(oRow2);
}
}
}
</script>
b框架所在页面
<table border="1" id="kk" width="100%" id="table1">
<tbody>
<tr>
<td> </td>
<td>1</td>
<td>2</td>
</tr></tbody>
</table>
---
提示kkk.appendChild(oRow2); 这行参数无效