Javascript 当用户单击iFrame时重定向它

Javascript 当用户单击iFrame时重定向它,javascript,html,css,iframe,frame,Javascript,Html,Css,Iframe,Frame,当用户单击iFrame时,如何将其重定向到另一个html网页 iFrame实际上是一个html页面。当我单击iFrame时,我希望它重定向到另一个html页面 我的代码: h1{ 文本对齐:居中; 字体系列:“Segoe UI”,塔荷马,日内瓦,Verdana,无衬线; } 氢{ 文本对齐:居中; 字体系列:“Segoe UI”,塔荷马,日内瓦,Verdana,无衬线; } 正文{ 背景色:#2月236日; } iframe{ 边框:2件纯黑; } 身体{ 高度:175vh; } div{ 边

当用户单击iFrame时,如何将其重定向到另一个html网页

iFrame实际上是一个html页面。当我单击iFrame时,我希望它重定向到另一个html页面

我的代码:

h1{
文本对齐:居中;
字体系列:“Segoe UI”,塔荷马,日内瓦,Verdana,无衬线;
}
氢{
文本对齐:居中;
字体系列:“Segoe UI”,塔荷马,日内瓦,Verdana,无衬线;
}
正文{
背景色:#2月236日;
}
iframe{
边框:2件纯黑;
}
身体{
高度:175vh;
}
div{
边框宽度:0.2px;
边框样式:实心;
位置:固定;
排名:0;
底部:0;
右:400px;
左:400px;
z指数:-1;
}

剽窃
剽窃
什么是剽窃?

什么是计算机科学中的剽窃?

著名的剽窃案

美国对剽窃的惩罚


用Javascript测试IFrame SRC
函数重定向页面()
{
document.getElementById(“frame1”).src=”http://WWW.microsoft.com";
}
这段代码也许可以帮助你

<html>
<head>
<title>Test IFrame SRC by Javascript </title>

<script>
function RedirectPage()
{
 document.getElementById("frame1").src = "http://WWW.microsoft.com";
}
</script>
</head>
<body>
<table>
<tr>
<td>
     <iframe name="frame1" src="http://www.w3schools.com" width="500px" height="500px"></iframe>
</td>
</tr>
<tr><td>
<input type="button" value="Change IFrame sRC Location" name="btnRedirect" runat="server" onclick="RedirectPage()"/>
</td></tr>
</table>

</body>
</html>