title: Javascript button switch between iframe sources
body: <p>I want to switch the source of an <code>iframe</code> when clicking on a button. What I've tried does not work. </p>
  
  <pre><code>&lt;input type="image" id="pluto" src="pluto.jpg" alt="pluto" width="150px" height="150px" style="margin-left: 45%;" onclick="function()"/&gt;
  
  &lt;script&gt;
      document.getElementById('pluto').onclick = function() {
      {
          var property = document.getElementById(iframe);
          if (document.getElementById("something").src = "http://www.w3schools.com/";) {
              document.getElementById("something").src = "http://agar.io/";    
          }
          else {
              document.getElementById("something").src = "http://www.w3schools.com/";
          }
      }
  &lt;/script&gt;
  &lt;iframe id='something' name="main" src="http://www.w3schools.com" style="border:none;width:100%;height:100%;margin-top:150px;"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>Please help me.</p>