title: How to display images and text search results using JavaScript?
body: <p>I have 2 dropdown select forms which validate the options the user chooses with a submit button but I'm not sure of the correct way to "add" my desired content to the search results. Ideally, this would be an image with a header and description.</p>
  
  <p>I tried adding an image using .innerHTML which works but this doesn't seem like the right way to go about it.</p>
  
  <p>Can someone point me in the right direction? Perhaps by providing an example.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function Confirm(){
   var people = document.getElementById ("people");
   var food = document.getElementById ("food");
  
   if ((people.value == "") &amp;&amp; (food.value == ""))
    { 
     alert ("option zero"); //test 
    } 
  
   else if ((people.value == "1") &amp;&amp;(food.value == "1"))
    { 
     alert ("option one"); //test
     document.getElementById("result1").innerHTML = "&lt;img src='images/tourism.jpg'&gt;";
    } 
  
   else if ((people.value == "2") &amp;&amp; (food.value == "2"))
    { 
     alert ("option two"); //test
     // document.getElementById("result1").innerHTML = "supasdasdasd";
    } 
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#result1{
   height: 400px;
   width: 400px;
   background-color: red;
  }
  
  #result2{
   height: 400px;
   width: 400px;
   background-color: blue;
  }
  
  img {
   max-width: 100%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
  
  &lt;form&gt;
  &lt;select id="people"&gt; 
        &lt;option value=""&gt; Please Select &lt;/option&gt;
        &lt;option value="1"&gt; one person  &lt;/option&gt;
        &lt;option value="2"&gt; two person &lt;/option&gt;
  &lt;/select&gt;
  
  &lt;select id="food"&gt; 
        &lt;option value=""&gt; Please Select &lt;/option&gt;
        &lt;option value="1"&gt; apple &lt;/option&gt;
        &lt;option value="2"&gt; banana  &lt;/option&gt;
  &lt;/select&gt;
  
  &lt;input type="button" value="confirm" onclick="Confirm()" /&gt;
  &lt;/form&gt;
  
   &lt;div id="result1"&gt;
  
   &lt;/div&gt;
  
   &lt;div id="result2"&gt;
  
   &lt;/div&gt;
  
    &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>