script与html问题.. 急!!!

来源:百度知道 编辑:UC知道 时间:2024/09/24 10:39:55
我想当按按钮的时候调用一个Script脚本,通过脚本往html里面添加一个子窗体,就是我已经有了一个页面,要往这个页面其中的一个<td>里添加<iframe>,连接另一个页面。Script要怎么实现呢??哪位高手帮帮忙

<table>
<tr>
<td id="ff"></td>
<td><input type="button" value="转到" onclick="redt();"></td>
</tr>
</table>
<script>
function redt()
{
document.getElementById("ff").innerHTML="<iframe name='res' src='a.htm' frameborder='0' scrolling='yes' height='100px' width='100px'></iframe>"
}
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title&