title: Changing iframe src with Javascript
body: <p>I am trying to change an <code>&lt;iframe src=... &gt;</code> when someone clicks a radio button. For some reason my code is not working correctly and I am having trouble figuring out why. Here is what I have:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;
    &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
    &lt;title&gt;Untitled 1&lt;/title&gt;
  
    &lt;script&gt;
    function go(loc) {
      document.getElementById('calendar').src = loc;
    }
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;iframe id="calendar" src="about:blank" width="1000" height="450" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
  
    &lt;form method="post"&gt;
      &lt;input name="calendarSelection" type="radio" onselect="go('http://calendar.zoho.com/embed/9a6054c98fd2ad4047021cff76fee38773c34a35234fa42d426b9510864356a68cabcad57cbbb1a0?title=Kevin_Calendar&amp;type=1&amp;l=en&amp;tz=America/Los_Angeles&amp;sh=[0,0]&amp;v=1')" /&gt;Day
      &lt;input name="calendarSelection" type="radio" onselect="go('http://calendar.zoho.com/embed/9a6054c98fd2ad4047021cff76fee38773c34a35234fa42d426b9510864356a68cabcad57cbbb1a0?title=Kevin_Calendar&amp;type=1&amp;l=en&amp;tz=America/Los_Angeles&amp;sh=[0,0]&amp;v=1')" /&gt;Week
      &lt;input name="calendarSelection" type="radio" onselect="go('http://calendar.zoho.com/embed/9a6054c98fd2ad4047021cff76fee38773c34a35234fa42d426b9510864356a68cabcad57cbbb1a0?title=Kevin_Calendar&amp;type=1&amp;l=en&amp;tz=America/Los_Angeles&amp;sh=[0,0]&amp;v=1')" /&gt;Month
    &lt;/form&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>