title: How to display html file in iframe using javascript
body: <p>i have here a catalogue code that I want to display the index.html file of the value to the iframe. it returns me "Page can't be displayed". Only HTML and Javascript must be used in this code.</p>
  
  <pre><code>&lt;script&gt;
  function display() {
  var cake = document.getElementById("type").value;
  document.getElementById('cakes').src = cake + '\index.html';
  }
  &lt;/script&gt;
      &lt;/head&gt;
  &lt;body&gt;
  &lt;center&gt;&lt;img src="LOGO.jpg" size=20%&gt;&lt;/img&gt;&lt;/center&gt;
  &lt;p&gt;&lt;center&gt;&lt;font face="Brush Script MT" size="32" color="lightblue" valign=middle&gt;YOU'RE SO SWEETS&lt;/font&gt;&lt;/center&gt;&lt;/p&gt;
  &lt;table valign=center&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;img src="home.png"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;img src="product.png"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;img src="online.png"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;img src="about.png"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;img src="contact.png"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;br&gt;
  &lt;select id="type" multiple onchange="display()"&gt;
  &lt;option value="special"&gt;Specialty Cakes&lt;/option&gt;
  &lt;option value="adult"&gt;Birthday Cakes for Adult&lt;/option&gt;
  &lt;option value="kids"&gt;Birthday Cakes for Kids&lt;/option&gt;
  &lt;option value="wedding"&gt;Wedding Cakes&lt;/option&gt;
  &lt;/select&gt;
  &lt;br&gt;
  &lt;iframe id="cakes" src=""&gt;&lt;/iframe&gt;
  </code></pre>