我需要一个按钮来更改它的URL以匹配屏幕上显示的iframe,我在这里面临的问题是如何使用JavaScript更改按钮的URL?用JavaScript更改JavaScript
这是我到现在为止:
<button id="t7"onclick="t7()">Full Pilot</button><br>
function f0() {document.getElementById('i').src="https://pilot.wright.edu/d2l/home";}
function f1() {document.getElementById('i').src="https://pilot.wright.edu/d2l/home/159483";}
function f2() {document.getElementById('i').src="https://pilot.wright.edu/d2l/le/content/219408/Home";}
function f3() {document.getElementById('i').src="https://pilot.wright.edu/d2l/home/159465";}
function f4() {document.getElementById('i').src="https://pilot.wright.edu/d2l/home/219301";}
function f5() {document.getElementById('i').src="https://pilot.wright.edu/d2l/home/159463";}
功能F0 - F5是我需要改变的代码第一行列出的按钮的URL的按钮。任何一个人都可以指出我可以这样做的方向,甚至可以指导我如何去做这件事。
这是一两件事,我曾尝试: “URL”
function t7() {window.open("document.getElementById("i").src="");}
你能告诉我们你尝试过什么到目前为止,并张贴演示重现你的具体问题? – elclanrs
问题是我对如何尝试这一点甚少了解。 – CMS2
那么你可能需要做更多的研究。我们期望代码在问题中寻求代码。尝试使用[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript)获得一般JavaScript知识。当你有一些代码时,请参阅[如何写一个好问题](https://msmvps.com/blogs/jon_skeet/archive/2010/08/29/writing-the-perfect-question.aspx),你是一半在那里。 – elclanrs