title: How to change img src with HTML5 and Javascript using radio button
body: <p>I am doing an assignment in which a web page displays the flag of a country based on what radio button is selected. The goal of the assignment is to use Javascript to change the src attribute of an img element. I do not believe we are supposed to use functions since those are not covered until the next chapter. I have followed all the guides in the current chapter but they only discuss changing text, not images. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Flags&lt;/title&gt;
          &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form name="CountryList" method="get"&gt;
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='argentina.jpg'" /&gt;Argentina
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='australia.jpg'" /&gt;Australia
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='bolivia.jpg'" /&gt;Bolivia
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='cuba.jpg'" /&gt;Cuba
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='finland.jpg'" /&gt;Finland
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='france.jpg'" /&gt;France
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='italy.jpg'" /&gt;Italy
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='peru.jpg'" /&gt;Peru
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='syria.jpg'" /&gt;Syria
                          &lt;br /&gt;
                          &lt;input type="radio" name="country" onclick="document.ProductImage.src='tunisia.jpg'" /&gt;Tunisia
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;a&gt;&lt;img id="ProductImage" src="" alt="Flag" /&gt;&lt;/a&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Could anybody point me in the right direction or let me know if it is impossible to change the img src attribute without functions?</p>
  
  <p>Thanks!</p>