title: changing JavaScript with JavaScript
body: <p>I need a button to change it's URL to match that of the iframe that is presented on the screen the problem I face here is how can I change the URL of the button with JavaScript? </p>
  
  <p>Here is what I have as of now:</p>
  
  <pre><code>   &lt;button id="t7"onclick="t7()"&gt;Full Pilot&lt;/button&gt;&lt;br&gt;
      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";}
  </code></pre>
  
  <p>the functions f0 - f5 are the buttons that I need to have change the URL of the button listed at very first line of code. can any one point me in the direction of which I can do this or even some ideas as to how I can go about doing this.</p>
  
  <p>Here is one thing I have tried:</p>
  
  <pre><code>    function t7() {window.open("document.getElementById("i").src="");}
  </code></pre>